superagentvscurl-impersonate
superagent is an HTTP client library for Node.js that provides a simple, flexible, and powerful API for making HTTP requests. It supports all major HTTP methods, and has a clean and easy-to-use interface for handling responses and errors.
what differentiates superagent from other http clients is its simple declarative API.
Curl-impersonate is a special build of libcurl
and cURL HTTP client that impersonates the four major browsers:
- Google Chrome
- Microsoft Edge
- Safari
- Firefox
Curl-impersonate achieves this by patching TLS and HTTP fingerprints to be identical to that of one of these real browsers.
Unlike other HTTP clients curl-impersonate can bypass TSL and HTTP fingerprinting and detection techniques though it does not implement anything for Javascript fingerprint or bypass.
Highlights
Example Use
const superagent = require('superagent');
// superagent supports both Promises and async/await
superagent.get('https://httpbin.org/get')
.then(res => console.log(res.text))
.catch(err => console.error(err));
const response = superagent.get('https://httpbin.org/get')
// post requests:
superagent.post('https://httpbin.org/post').send({ name: 'John Doe' })
// setting proxy
superagent.get('https://httpbin.org/ip').proxy('http://proxy.example.com:8080')
// settings headers and proxies
superagent.get('https://httpbin.org/headers').set('Cookie', 'myCookie=123').set('X-My-Header', 'myValue')
$ curl_chrome116 https://www.wikipedia.org