Stories from the Web Crawling trenches in request headers

Making HTTP POST Requests with Httpx in Python

Author: Mohan Ganesan

Date: Feb 5, 2024

Httpx library in Python provides a modern and intuitive HTTP client for making POST requests to APIs and web services. It handles request headers, form data, timeouts, retries, and more.

Fetching Content with aiohttp in Python

Author: Mohan Ganesan

Date: Mar 3, 2024

The aiohttp library is a powerful tool for making asynchronous HTTP requests in Python. This guide demonstrates practical examples of using aiohttp to fetch content, handle errors, set request headers, post form data, stream response content, configure timeouts, and provides practical tips for working with aiohttp.

Inspecting Requests in Python with the Requests Library

Author: Mohan Ganesan

Date: Feb 3, 2024

The Python Requests library makes sending HTTP requests simple. Use request.headers to view the headers sent in a Requests request. Access the request body with request.body. Set json instead of data parameter to have readable body printed.

Making HTTP Requests in Python with HTTPX

Author: Mohan Ganesan

Date: Feb 5, 2024

Python HTTP client HTTPX simplifies making HTTP requests, supports HTTP/1.1 and HTTP/2, and offers features like timeouts and retries.

Tired of getting blocked while scraping the web?

ProxiesAPI handles headless browsers and rotates proxies for you.
Get access to 1,000 free API credits, no credit card required!