POST 请求
通过将请求体 POST 到 Web Scraping API,并将 api_key 和 url 作为查询参数,把 POST 请求转发到目标 URL。适用于表单提交和 JSON API 端点。
Endpoint
Section titled “Endpoint” POST https://scrape.shifter.io/v1?api_key=YOUR_API_KEY&url=<TARGET_URL>
Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
api_key | string | yes | 您的 Web Scraping API 密钥 |
url | string | yes | 要 POST 到的目标 URL |
请求体会原样转发到目标 URL。
Example request
Section titled “Example request”curl -X POST "https://scrape.shifter.io/v1?api_key=YOUR_API_KEY&url=https%3A%2F%2Fhttpbin.org%2Fpost" \ -H "Content-Type: application/json" \ --data '{"foo":"bar"}'import requests
r = requests.post( "https://scrape.shifter.io/v1", params={"api_key": "YOUR_API_KEY", "url": "https://httpbin.org/post"}, json={"foo": "bar"},)print(r.json())import fetch from 'node-fetch';
const url = 'https://scrape.shifter.io/v1?' + new URLSearchParams({ api_key: 'YOUR_API_KEY', url: 'https://httpbin.org/post',});const res = await fetch(url, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ foo: 'bar' }),});console.log(await res.json());Example response
Section titled “Example response”{ "args": {}, "data": "{\"foo\":\"bar\"}", "headers": { "Content-Type": "application/json", "Host": "httpbin.org" }, "json": { "foo": "bar" }, "origin": "185.162.168.36", "url": "https://httpbin.org/post"}