Custom Headers
Custom Headers example
curl --request GET --url "https://scrape.shifter.io/v1?api_key=api_key&url=http%3A%2F%2Fhttpbin.org%2Fheaders" --header "Wsa-My-header: test" --header "Wsa-User-Agent: potato"const http = require("https");
const options = {
"method": "GET",
"hostname": "scrape.shifter.io",
"port": null,
"path": "/v1?api_key=api_key&url=http%3A%2F%2Fhttpbin.org%2Fheaders",
"headers": {
"Wsa-My-header": "test",
"Wsa-User-Agent": "potato"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});{
"headers": {
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"Accept-Encoding": "gzip, deflate, br",
"Host": "httpbin.org",
"My-Header": "test",
"Upgrade-Insecure-Requests": "1",
"User-Agent": "potato",
"X-Amzn-Trace-Id": "Root=1-6267c064-44fa9993017cfcc32e41dfc1"
}
}Last updated
Was this helpful?