📜  proxycurl (1)

📅  最后修改于: 2023-12-03 14:45:40.800000             🧑  作者: Mango

Proxycurl

Proxycurl is a Python package that provides an easy and intuitive interface to make HTTP requests through a proxy. With Proxycurl, you can send HTTP requests from your Python code through a proxy server without having to worry about the low-level details of setting up and maintaining a proxy connection.

Installation

You can install Proxycurl via pip:

pip install proxycurl
Usage

Using Proxycurl is very straightforward. To send an HTTP request through a proxy, simply create a Proxycurl object and call the request() method:

from proxycurl import Proxycurl

proxy_url = 'http://my-proxy-server.com:8080'
proxycurl = Proxycurl(proxy_url)

response = proxycurl.request('GET', 'https://www.google.com')
print(response.status_code)
print(response.text)

In the example above, we create a Proxycurl object with the URL of our proxy server (my-proxy-server.com:8080). We then call the request() method with the HTTP method (GET) and the URL of the resource we want to request (https://www.google.com). request() returns a Response object, which we can then use to access the response data.

Features

Proxycurl provides several features to make it easy to work with proxies in Python:

  • Simple API: Proxycurl's API is straightforward and easy to use, making it simple to send HTTP requests through a proxy.
  • Support for HTTP and HTTPS: Proxycurl supports both HTTP and HTTPS requests through a proxy.
  • Customizable proxy authentication: Proxycurl provides support for a wide range of authentication methods, making it easy to work with proxies that require authentication.
  • Persistent connections: Proxycurl can be configured to use persistent connections, allowing you to reuse connections across multiple requests.
  • Automatic user-agent rotation: Proxycurl can be configured to automatically rotate the user-agent header on every request, making it easy to avoid detection and prevent blocking by web servers.
Conclusion

Proxycurl is a powerful and easy-to-use Python package for making HTTP requests through a proxy. With Proxycurl, you can enjoy all the benefits of using a proxy without worrying about the details of the proxy setup. Give it a try today and see how it can simplify your proxy-based projects.