获取http请求标头_HTTP请求标头列表

获取http请求标头

标准头 (Standard headers)

目标 (A-IM)

A-IM: feed

A-IM: feed

Instance manipulations that are acceptable in the response. Defined in RFC 3229

响应中可接受的实例操作。 在RFC 3229中定义

接受 (Accept)

Accept: application/json

Accept: application/json

The media type/types acceptable

可接受的媒体类型

接受字符集 (Accept-Charset)

Accept-Charset: utf-8

Accept-Charset: utf-8

The charset acceptable

可接受的字符集

接受编码 (Accept-Encoding)

Accept-Encoding: gzip, deflate

Accept-Encoding: gzip, deflate

List of acceptable encodings

可接受的编码列表

接受语言 (Accept-Language)

Accept-Language: en-US

Accept-Language: en-US

List of acceptable languages

可接受的语言列表

接受日期时间 (Accept-Datetime)

Accept-Datetime: Thu, 31 May 2007 20:35:00 GMT

Accept-Datetime: Thu, 31 May 2007 20:35:00 GMT

Request a past version of the resource prior to the datetime passed

在传递的日期时间之前请求资源的过去版本

访问控制请求方法 (Access-Control-Request-Method)

Access-Control-Request-Method: GET

Access-Control-Request-Method: GET

Used in a CORS request

CORS要求中使用

访问控制请求标头 (Access-Control-Request-Headers)

Access-Control-Request-Headers: origin, x-requested-with, accept

Access-Control-Request-Headers: origin, x-requested-with, accept

Used in a CORS request

CORS要求中使用

授权书 (Authorization)

Authorization: Basic 34i3j4iom2323==

Authorization: Basic 34i3j4iom2323==

HTTP basic authentication credentials

HTTP基本身份验证凭据

缓存控制 (Cache-Control)

Cache-Control: no-cache

Cache-Control: no-cache

Set the caching rules

设置缓存规则

连接 (Connection)

Connection: keep-alive

Connection: keep-alive

Control options for the current connection. Accepts keep-alive and close. Deprecated in HTTP/2

当前连接的控制选项。 接受keep-aliveclose 。 在HTTP / 2中已弃用

内容长度 (Content-Length)

Content-Length: 348

Content-Length: 348

The length of the request body in bytes

请求主体的长度(以字节为单位)

内容类型 (Content-Type)

Content-Type: application/x-www-form-urlencoded

Content-Type: application/x-www-form-urlencoded

The content type of the body of the request (used in POST and PUT requests).

请求正文的内容类型(用于POST和PUT请求)。

Cookie: name=value

Cookie: name=value

See more on Cookies

在Cookie上查看更多

日期 (Date)

Date: Tue, 15 Nov 1994 08:12:31 GMT

Date: Tue, 15 Nov 1994 08:12:31 GMT

The date and time that the request was sent

发送请求的日期和时间

期望 (Expect)

Expect: 100-continue

Expect: 100-continue

It’s typically used when sending a large request body. We expect the server to return back a 100 Continue HTTP status if it can handle the request, or 417 Expectation Failed if not

通常在发送大型请求正文时使用。 如果服务器可以处理请求,我们希望服务器返回100 Continue HTTP状态,否则,则返回417 Expectation Failed

已转发 (Forwarded)

Forwarded: for=192.0.2.60; proto=http; by=203.0.113.43

Forwarded: for=192.0.2.60; proto=http; by=203.0.113.43

Disclose original information of a client connecting to a web server through an HTTP proxy. Used for testing purposes only, as it discloses privacy sensitive information

公开通过HTTP代理连接到Web服务器的客户端的原始信息。 仅用于测试目的,因为它会泄露隐私敏感信息

(From)

From: user@example.com

From: user@example.com

The email address of the user making the request. Meant to be used, for example, to indicate a contact email for bots.

发出请求的用户的电子邮件地址。 例如,用于表示机器人的联系电子邮件的意思。

主办 (Host)

Host: flaviocopes.com

Host: flaviocopes.com

The domain name of the server (used to determined the server with virtual hosting), and the TCP port number on which the server is listening. If the port is omitted, 80 is assumed. This is a mandatory HTTP request header

服务器的域名(用于确定具有虚拟主机的服务器),以及服务器正在侦听的TCP端口号。 如果省略端口,则假定为80。 这是强制性的HTTP请求标头

如果匹配 (If-Match)

If-Match: "737060cd8c284d8582d"

If-Match: "737060cd8c284d8582d"

Given one (or more) ETags, the server should only send back the response if the current resource matches one of those ETags. Mainly used in PUT methods to update a resource only if it has not been modified since the user last updated it

给定一个(或多个) ETags ,服务器应仅在当前资源与那些ETag之一匹配时发送回响应。 仅在自用户上次更新资源以来未对其进行修改的情况下,主要用于PUT方法中以更新资源

如果自修改 (If-Modified-Since)

If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT

If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT

Allows to return a 304 Not Modified response header if the content is unchanged since that date

如果自该日期以来内容未更改,则允许返回304 Not Modified响应标头

如果不匹配 (If-None-Match)

If-None-Match: "737060cd882f209582d"

If-None-Match: "737060cd882f209582d"

Allows a 304 Not Modified response header to be returned if content is unchanged. Opposite of If-Match.

如果内容不变,则允许返回304 Not Modified响应头。 与If-Match相反。

如果范围 (If-Range)

If-Range: "737060cd8c9582d"

If-Range: "737060cd8c9582d"

Used to resume downloads, returns a partial if the condition is matched (ETag or date) or the full resource if not. See more

用于恢复下载,如果条件(ETag或日期)匹配则返回部分资源,否则返回完整资源。 看更多

如果自修改以来 (If-Unmodified-Since)

If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT

If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT

Only send the response if the entity has not been modified since the specified time

仅在自指定时间以来未修改实体的情况下才发送响应

最大前进 (Max-Forwards)

Max-Forwards: 10

Max-Forwards: 10

Limit the number of times the message can be forwarded through proxies or gateways

限制可以通过代理或网关转发邮件的次数

起源 (Origin)

Origin: http://mydomain.com

Origin: http://mydomain.com

Send the current domain to perform a CORS request, used in an OPTIONS HTTP request (to ask the server for Access-Control- response headers)

发送当前域以执行OPTIONS HTTP请求中使用的CORS请求(向服务器询问Access-Control-响应头)

语用 (Pragma)

Pragma: no-cache

Pragma: no-cache

Used for backwards compatibility with HTTP/1.0 caches

用于与HTTP / 1.0缓存向后兼容

代理授权 (Proxy-Authorization)

Proxy-Authorization: Basic 2323jiojioIJOIOJIJ==

Proxy-Authorization: Basic 2323jiojioIJOIOJIJ==

Authorization credentials for connecting to a proxy

用于连接到代理的授权凭证

范围 (Range)

Range: bytes=500-999

Range: bytes=500-999

Request only a specific part of a resource

仅请求资源的特定部分

推荐人 (Referer)

Referer: https://flaviocopes.com

Referer: https://flaviocopes.com

The address of the previous web page from which a link to the currently requested page was followed.

上一个网页的地址,从中指向当前请求页面的链接。

TE (TE)

TE: trailers, deflate

TE: trailers, deflate

Specify the encodings the client can accept. Accepted values: compress, deflate, gzip, trailers. Only trailers is supported in HTTP/2

指定客户端可以接受的编码。 接受的值: compressdeflategziptrailers 。 HTTP / 2仅支持trailers

用户代理 (User-Agent)

User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36

User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36

The string that identifies the user agent

标识用户代理的字符串

升级 (Upgrade)

Upgrade: h2c, HTTPS/1.3, IRC/6.9, RTA/x11, websocket

Upgrade: h2c, HTTPS/1.3, IRC/6.9, RTA/x11, websocket

Ask the server to upgrade to another protocol. Deprecated in HTTP/2

要求服务器升级到另一个协议。 在HTTP / 2中已弃用

通过 (Via)

Via: 1.0 fred, 1.1 example.com (Apache/1.1)

Via: 1.0 fred, 1.1 example.com (Apache/1.1)

Informs the server of proxies through which the request was sent

通知服务器通过其发送请求的代理

警告 (Warning)

Warning: 199 Miscellaneous warning

Warning: 199 Miscellaneous warning

A general warning about possible problems with the status of the message. Accepts a special range of values.

有关消息状态可能存在问题的一般警告。 接受特殊范围的值。

非标头 (Non-standard headers)

There are some widely used non-standard headers as well, including:

还有一些广泛使用的非标准标头,包括:

Dnt (Dnt)

DNT: 1

DNT: 1

If enabled, asks servers to not track the user

如果启用,则要求服务器不跟踪用户

X-Requested-With (X-Requested-With)

X-Requested-With: XMLHttpRequest

X-Requested-With: XMLHttpRequest

Identifies XHR requests

识别XHR请求

X-CSRF-Token (X-CSRF-Token)

X-CSRF-Token: <TOKEN>

X-CSRF-Token: <TOKEN>

Used to prevent CSRF

用于防止CSRF

翻译自: https://flaviocopes.com/http-request-headers/

获取http请求标头

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值