Skip to content
登录 注册

自定义请求头

通过添加 Wsa- 前缀,将任意请求头附加到发出的抓取请求中。API 会去除该前缀,并将请求头转发给目标站点。

GET https://scrape.shifter.io/v1?api_key=YOUR_API_KEY&url=<TARGET_URL>
参数类型是否必填说明
api_keystring您的 Web Scraping API 密钥
urlstring要获取的目标 URL
Wsa-*(请求头)string任何以 Wsa- 为前缀的请求头都会在去除该前缀后转发给目标站点。
Terminal window
curl "https://scrape.shifter.io/v1?api_key=YOUR_API_KEY&url=http%3A%2F%2Fhttpbin.org%2Fheaders" \
-H "Wsa-My-header: test" \
-H "Wsa-User-Agent: potato"
{
"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"
}
}