HTTP请求类型详解
<head>
协议状态代码描述HTTP响应的第一行类似于HTTP请求的第一行,它表示通信所用的协议是HTTP1.1服务器已经成功的处理了客户端发出的请求(200表示成功):
响应头(Response Header)响应头也和请求头一样包含许多有用的信息,例如服务器类型、日期时间、内容类型和长度等:
<head>
应用最常见的用途之一是电子商务,可以利用Web服务器端程序使人们能够网络购物,需要指出一点是,缺省情况下,通过Internet发送信息是不安全
的,如果某人碰巧截获了你发给朋友的一则消息,他就能打开它,假想在里面有你的信用卡号码,这会有多么糟糕,幸运的是,很多Web服务器以及Web浏览器
都有创立安全连接的能力,这样它们就可以安全的通信了。
提供安全连接最常见的标准是安全套接层(Secure Sockets
layer,SSl)协议。SSL协议是一个应用层协议(和HTTP一样),用于安全方式在Web上交换数据,SSL使用公开密钥编码系统。从本质讲,这
意味着业务中每一方都拥有一个公开的和一个私有的密钥。当一方使用另一方公开密钥进行编码时,只有拥有匹配密钥的人才能对其解码。简单来讲,公开密钥编码
提供了一种用于在两方之间交换数据的安全方法,SSL连接建立之后,客户和服务器都交换公开密钥,并在进行业务联系之前进行验证,一旦双方的密钥都通过验
证,就可以安全地交换数据。
- GET
通过请求URI得到资源 - POST,
用于添加新的内容 - PUT
用于修改某个内容 - DELETE,
删除某个内容 - CONNECT,
用于代理进行传输,如使用SSL - OPTIONS
询问可以执行哪些方法 - PATCH,
部分文档更改 - PROPFIND, (wedav)
查看属性 - PROPPATCH, (wedav)
设置属性 - MKCOL, (wedav)
创建集合(文件夹) - COPY, (wedav)
拷贝 - MOVE, (wedav)
移动 - LOCK, (wedav)
加锁 - UNLOCK (wedav)
解锁 - TRACE
用于远程诊断服务器 - HEAD
类似于GET, 但是不返回body信息,用于检查对象是否存在,以及得到对象的元数据
GET
, POST
, PUT
, DELETE
, CONNECT
,OPTIONS
, PATCH
, PROPFIND
, PROPPATCH
, MKCOL
, COPY
, MOVE
, LOCK
, 和 UNLOCK
.RFC 2616 Fielding, et al.
this set can be expanded, additional methods cannot be assumed to share
the same semantics for separately extended clients and servers.
in their interactions over the Internet, and should be careful to allow
the user to be aware of any actions they might take which may have an
unexpected significance to themselves or others.
HEAD methods SHOULD NOT have the significance of taking an action other
than retrieval. These methods ought to be considered "safe". This
allows user agents to represent other methods, such as POST, PUT and
DELETE, in a special way, so that the user is made aware of the fact
that a possibly unsafe action is being requested.
generate side-effects as a result of performing a GET request; in fact,
some dynamic resources consider that a feature. The important
distinction here is that the user did not request the side-effects, so
therefore cannot be held accountable for them.
from error or expiration issues) the side-effects of N > 0 identical
requests is the same as for a single request. The methods GET, HEAD, PUT
and DELETE share this property. Also, the methods OPTIONS and TRACE
SHOULD NOT have side effects, and so are inherently idempotent.
idempotent, even if all of the methods executed in that sequence are
idempotent. (A sequence is idempotent if a single execution of the
entire sequence always yields a result that is not changed by a
reexecution of all, or part, of that sequence.) For example, a sequence
is non-idempotent if its result depends on a value that is later
modified in the same sequence.
(provided that no concurrent operations are being executed on the same
set of resources).
communication options available on the request/response chain identified
by the Request-URI. This method allows the client to determine the
options and/or requirements associated with a resource, or the
capabilities of a server, without implying a resource action or
initiating a resource retrieval.
presence of Content-Length or Transfer-Encoding), then the media type
MUST be indicated by a Content-Type field. Although this specification
does not define any use for such a body, future extensions to HTTP might
use the OPTIONS body to make more detailed queries on the server. A
server that does not support such an extension MAY discard the request
body.
intended to apply to the server in general rather than to a specific
resource. Since a server's communication options typically depend on the
resource, the "*" request is only useful as a "ping" or "no-op" type of
method; it does nothing beyond allowing the client to test the
capabilities of the server. For example, this can be used to test a
proxy for HTTP/1.1 compliance (or lack thereof).
only to the options that are available when communicating with that
resource.
optional features implemented by the server and applicable to that
resource (e.g., Allow), possibly including extensions not defined by
this specification. The response body, if any, SHOULD also include
information about the communication options. The format for such a
future extensions to HTTP. Content negotiation MAY be used to select the
appropriate response format. If no response body is included, the
response MUST include a Content-Length field with a field-value of "0".
specific proxy in the request chain. When a proxy receives an OPTIONS
request on an absoluteURI for which request forwarding is permitted, the
proxy MUST check for a Max-Forwards field. If the Max-Forwards
field-value is zero ("0"), the proxy MUST NOT forward the message;
instead, the proxy SHOULD respond with its own communication options. If
the Max-Forwards field-value is an integer greater than zero, the proxy
MUST decrement the field-value when it forwards the request. If no
Max-Forwards field is present in the request, then the forwarded request
MUST NOT include a Max-Forwards field.
an entity) is identified by the Request-URI. If the Request-URI refers
to a data-producing process, it is the produced data which shall be
returned as the entity in the response and not the source text of the
process, unless that text happens to be the output of the process.
the request message includes an If-Modified-Since, If-Unmodified-Since,
If-Match, If-None-Match, or If-Range header field. A conditional GET
method requests that the entity be transferred only under the
circumstances described by the conditional header field(s). The
conditional GET method is intended to reduce unnecessary network usage
by allowing cached entities to be refreshed without requiring multiple
requests or transferring data already held by the client.
request message includes a Range header field. A partial GET requests
that only part of the entity be transferred, as described in section 14.35.
The partial GET method is intended to reduce unnecessary network usage
by allowing partially-retrieved entities to be completed without
transferring data already held by the client.
return a message-body in the response. The metainformation contained in
the HTTP headers in response to a HEAD request SHOULD be identical to
the information sent in response to a GET request. This method can be
used for obtaining metainformation about the entity implied by the
request without transferring the entity-body itself. This method is
often used for testing hypertext links for validity, accessibility, and
recent modification.
the information contained in the response MAY be used to update a
previously cached entity from that resource. If the new field values
indicate that the cached entity differs from the current entity (as
would be indicated by a change in Content-Length, Content-MD5, ETag or
Last-Modified), then the cache MUST treat the cache entry as stale.
the entity enclosed in the request as a new subordinate of the resource
identified by the Request-URI in the Request-Line. POST is designed to
allow a uniform method to cover the following functions:
- Annotation of existing resources;
- Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles;
- Providing a block of data, such as the result of submitting a form, to a data-handling process;
- Extending a database through an append operation.
HTTP请求类型详解的更多相关文章
- Ajax 请求之_请求类型详解
$.ajax({ url: "规定发送请求的 URL.默认是当前页面.", type: "post", // 请求类型,默认get // 在回调函数中,无需将j ...
- C#进阶系列——WebApi 接口返回值不困惑:返回值类型详解
前言:已经有一个月没写点什么了,感觉心里空落落的.今天再来篇干货,想要学习Webapi的园友们速速动起来,跟着博主一起来学习吧.之前分享过一篇 C#进阶系列——WebApi接口传参不再困惑:传参详解 ...
- HTTP请求方法详解
HTTP请求方法详解 请求方法:指定了客户端想对指定的资源/服务器作何种操作 下面我们介绍HTTP/1.1中可用的请求方法: [GET:获取资源] GET方法用来请求已被URI识别的资源.指定 ...
- Spring RestController 请求参数详解
Spring RestController 请求参数详解 引用作者jpfss 在阅读之前,最好先了解http请求的get,post,以及各种head头类型,请求参数类型. 无参数,设置RestCont ...
- (转)C# WebApi 接口返回值不困惑:返回值类型详解
原文地址:http://www.cnblogs.com/landeanfen/p/5501487.html 正文 前言:已经有一个月没写点什么了,感觉心里空落落的.今天再来篇干货,想要学习Webapi ...
- [转]C#进阶系列——WebApi 接口返回值不困惑:返回值类型详解
本文转自:http://www.cnblogs.com/landeanfen/p/5501487.html 阅读目录 一.void无返回值 二.IHttpActionResult 1.Json(T c ...
- JS JSOP跨域请求实例详解
JSONP(JSON with Padding)是JSON的一种“使用模式”,可用于解决主流浏览器的跨域数据访问的问题.这篇文章主要介绍了JS JSOP跨域请求实例详解的相关资料,需要的朋友可以参考下 ...
- C++11 并发指南六(atomic 类型详解四 C 风格原子操作介绍)
前面三篇文章<C++11 并发指南六(atomic 类型详解一 atomic_flag 介绍)>.<C++11 并发指南六( <atomic> 类型详解二 std::at ...
- C++11 并发指南六(atomic 类型详解三 std::atomic (续))
C++11 并发指南六( <atomic> 类型详解二 std::atomic ) 介绍了基本的原子类型 std::atomic 的用法,本节我会给大家介绍C++11 标准库中的 std: ...
随机推荐
- dubbo spring2.5.6与spring 3冲突解决
dubbo的详细资料请参考: http://alibaba.github.io/dubbo-doc-static/Administrator+Guide-zh.htm#AdministratorGui ...
- ccleaner的专业版和商业版的注册码
名称:Registered User 密钥:CBB4-FJN4-EPC6-G5P6-QT4C 断网注册
- 转自 z55250825 的几篇关于FFT的博文(二)
题目大意:高精度乘法. fft的实现貌似有很多种,咱先写的是一种递归的fft,应该算是比较快的了吧.参考了 Evil君 的代码,那个运算符重载看的咱P党泪流满面. (没想到P竟然有运算符重载咩 ...
- [转] HDU 题目分类
转载来自:http://www.cppblog.com/acronix/archive/2010/09/24/127536.aspx 分类一: 基础题:1000.1001.1004.1005.1008 ...
- mac 软件安装
[Mac]PS CC 软件下载及破解的详细方法 为github帐号添加SSH keys 在mac下,打开文件都是“Smart Adobe CC Blocker v1.0”已损坏,打不开 brew ma ...
- htmlparser 精确提取的一些代码
一. ConnectionManager manager = Page.getConnectionManager(); Parser parser = new Parser(manager .open ...
- C#替换双引号
context = context.Replace(@"""", "");
- 【CSS3】Advanced10:Gradient
1.background:linear-gradient(20deg/(to) bottom right,orange,red,hsl(60,100%,50%)); 2.-webkit-chrome/ ...
- linux驱动程序之电源管理 之linux休眠与唤醒(2)
在Linux中,休眠主要分三个主要的步骤:(1)冻结用户态进程和内核态任务:(2)调用注册的设备的suspend的回调函数:(3)按照注册顺序休眠核心设备和使CPU进入休眠态. 冻结进程是 ...
- C语言之Static
1.全局静态变量 在全局变量之前加上关键字static,全局变量就被定义成为一个全局静态变量. 1)内存中的位置:静态存储区(静态存储区在整个程序运行期间都存在) 2)初始化:未经初始化的全局静态变量 ...