PUT 请求
通过将请求正文发送到 Web Scraping API,并使用 api_key 和 url 作为查询参数,将 PUT 请求转发到目标 URL。使用此功能可驱动需要 PUT 的 REST 端点。
Endpoint
Section titled “Endpoint” PUT 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 | 要 PUT 到的目标 URL |
请求正文将按原样转发到目标 URL。
Example request
Section titled “Example request”curl -X PUT "https://scrape.shifter.io/v1?api_key=YOUR_API_KEY&url=https%3A%2F%2Fhttpbin.org%2Fput" \ -H "Content-Type: application/json" \ --data '{"foo":"bar"}'import requests
r = requests.put( "https://scrape.shifter.io/v1", params={"api_key": "YOUR_API_KEY", "url": "https://httpbin.org/put"}, 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/put',});const res = await fetch(url, { method: 'PUT', 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/put"}