# 标头和 Cookie

- Smart Proxy 自动将您的大部分请求标头和 Cookie 通过以下方式转发到目标网站 Crawling API。这允许您像直接请求一样发送自定义标头或 Cookie。 User-Agent 请求中的标头将按原样转发到目标。如果您发送空白 User-Agent, Smart Proxy 将为您旋转。

代理本身使用的某些标头,例如 HostProxy-Authorization,不予转发。

以下是如何在请求中发送自定义标头和 Cookie 的示例。以下示例中的标头和 Cookie 将由 Smart Proxy 并在提出请求时使用 https://httpbin.org/anything.

使用 HTTP:

# Using Smart 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 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"