# 标头和 Cookie
这个 Smart AI Proxy 通过以下方式自动将您的大部分请求标头和 cookie 转发到目标网站: Crawling API。这允许您像直接请求一样发送自定义标头或 Cookie。 User-Agent 请求中的标头将按原样转发到目标。如果您发送空白 User-Agent, Smart AI Proxy 我会帮你旋转它。
代理本身使用的某些标头,例如 Host 与 Proxy-Authorization,不予转发。
以下示例展示了如何随请求发送自定义标头和 Cookie。以下示例中的标头和 Cookie 将由服务器转发。 Smart AI Proxy 并在发出请求时使用 https://httpbin.org/anything.
使用 HTTP:
# Using Smart AI Proxy with custom headers and cookies
curl \
-H "Accept-Language: en-US,en;q=0.9" \
-H "X-Custom-Header: My-Custom-Value" \
-H "User-Agent: MyCustomBrowser/1.0" \
--cookie "mycookie=myvalue; anothercookie=anothervalue" \
-x "http://[email protected]:8012" \
-k "https://httpbin.org/anything"
使用 HTTPS:
# Using Smart AI Proxy with custom headers and cookies
curl \
-H "Accept-Language: en-US,en;q=0.9" \
-H "X-Custom-Header: My-Custom-Value" \
-H "User-Agent: MyCustomBrowser/1.0" \
--cookie "mycookie=myvalue; anothercookie=anothervalue" \
-x "https://[email protected]:8013" \
-k "https://httpbin.org/anything"