rfc

Is the use of Location header in HTTP 202 response RFC-compliant?

痴心易碎 提交于 2019-11-29 16:38:20
问题 I have a great conceptual discussion with my coworkers about the use of Location header in 202 Accepted response. The story began analyzing the behavior of PHP header() function from here. The interesting excerpt: The second special case is the "Location:" header. Not only does it send this header back to the browser, but it also returns a REDIRECT (302) status code to the browser unless the 201 or a 3xx status code has already been set. They didn't include 202 status code in this default

Status Code状态码详解对照表

依然范特西╮ 提交于 2019-11-29 10:20:42
Status Code状态码详解对照表 状态码 含义 100 客户端应当继续发送请求。这个临时响应是用来通知客户端它的部分请求已经被服务器接收,且仍未被拒绝。客户端应当继续发送请求的剩余部分,或者如果请求已经完成,忽略这个响应。服务器必须在请求完成后向客户端发送一个最终响应。 101 服务器已经理解了客户端的请求,并将通过Upgrade 消息头通知客户端采用不同的协议来完成这个请求。在发送完这个响应最后的空行后,服务器将会切换到在Upgrade 消息头中定义的那些协议。   只有在切换新的协议更有好处的时候才应该采取类似措施。例如,切换到新的HTTP 版本比旧版本更有优势,或者切换到一个实时且同步的协议以传送利用此类特性的资源。 102 由WebDAV(RFC 2518)扩展的状态码,代表处理将被继续执行。 200 请求已成功,请求所希望的响应头或数据体将随此响应返回。 201 请求已经被实现,而且有一个新的资源已经依据请求的需要而建立,且其 URI 已经随Location 头信息返回。假如需要的资源无法及时建立的话,应当返回 '202 Accepted'。 202 服务器已接受请求,但尚未处理。正如它可能被拒绝一样,最终该请求可能会也可能不会被执行。在异步操作的场合下,没有比发送这个状态码更方便的做法了。   返回202状态码的响应的目的是允许服务器接受其他过程的请求

http 请求code状态码

醉酒当歌 提交于 2019-11-29 06:24:27
状态码 含义 100 客户端应当继续发送请求。这个临时响应是用来通知客户端它的部分请求已经被服务器接收,且仍未被拒绝。客户端应当继续发送请求的剩余部分,或者如果请求已经完成,忽略这个响应。服务器必须在请求完成后向客户端发送一个最终响应。 101 服务器已经理解了客户端的请求,并将通过Upgrade 消息头通知客户端采用不同的协议来完成这个请求。在发送完这个响应最后的空行后,服务器将会切换到在Upgrade 消息头中定义的那些协议。   只有在切换新的协议更有好处的时候才应该采取类似措施。例如,切换到新的HTTP 版本比旧版本更有优势,或者切换到一个实时且同步的协议以传送利用此类特性的资源。 102 由WebDAV(RFC 2518)扩展的状态码,代表处理将被继续执行。 200 请求已成功,请求所希望的响应头或数据体将随此响应返回。 201 请求已经被实现,而且有一个新的资源已经依据请求的需要而建立,且其 URI 已经随Location 头信息返回。假如需要的资源无法及时建立的话,应当返回 '202 Accepted'。 202 服务器已接受请求,但尚未处理。正如它可能被拒绝一样,最终该请求可能会也可能不会被执行。在异步操作的场合下,没有比发送这个状态码更方便的做法了。   返回202状态码的响应的目的是允许服务器接受其他过程的请求(例如某个每天只执行一次的基于批处理的操作)

What are RFC's?

落花浮王杯 提交于 2019-11-29 06:24:01
问题 I think there are a lot of people out there unaware of RFC's (Request for Comments). I know what they are at a logical level, but can anybody give a good description for a new developer? Also, sharing some resources on how to use and read them would be nice. 回答1: The term comes from the days of ARPANET, the predecessor to the internet, where the researchers would basically just throw ideas out there to, well, make a request for comments from the other researchers on the project. They could be

Which date formats are IETF-compliant RFC 2822 timestamps?

大城市里の小女人 提交于 2019-11-29 06:03:08
I need to parse dates in JavaScript. The format is [2 digits day]/[2 digits month]/[4 digits year] [2 digits hour (24 mode)]:[2 digits minute] For example, 16/02/2013 21:00 But if I do new Date('16/02/2013 21:00').toString() , it gives 'Wed Apr 02 2014 21:00:00 GMT+0200 (Hora de verano romance)' . I guess that's because my dates don't follow IETF RFC 2822 Date and Time Specification. Then, I should convert my string, and I want to convert it to the most similar compliant format (because it should be easier to convert). But http://tools.ietf.org/html/rfc2822#page-14 is hard to understand, so I

How to fragment H264 Packets in RTP compliant with RFC3984

橙三吉。 提交于 2019-11-29 02:52:28
问题 I have the FFMPEG streaming baseline h264 video, which I have to encapsulate in RTP and send to SIP phones for their decoding. I am using Linphone with the h264 plugin for Windows and Mirial for the decoding progress. However, sometimes I get a huge frame size (3Kb ~ 9Kb) from the FFMPEG, which obviously doesn't fit in the MTU. If I send these frames "as is" and trusting IP fragmentation feature, some phones are able to play it well enough, but others choke and can't decode the stream. I

Can . (period) be part of the path part of an URL?

不羁的心 提交于 2019-11-29 01:01:42
Is the following URL valid? http://www.example.com/module.php/lib/lib.php According to http://tools.ietf.org/html/rfc1738 section the hpath element of an URL can not contain a '.' (period). There is in the above case a '.' after "module" which is not allowed according to RFC1738. Am I reading the RFC wrong or is this RFC succeed by another RFC? Some other RFC's allows '.' in URLs ( http://tools.ietf.org/html/rfc1808 ). I don't see where RFC1738 disallows periods (.) in URLs. Here are some excerpts from there: hpath = hsegment *[ "/" hsegment ] hsegment = *[ uchar | ";" | ":" | "@" | "&" | "="

What is the maximum length of a DNS name

心不动则不痛 提交于 2019-11-29 00:06:24
问题 I saw several mentions that the maximum string length of a DNS name (domain name) is 253 characters. Wikipedia seems to be referring this old blog post: https://en.wikipedia.org/wiki/Hostname http://blogs.msdn.com/b/oldnewthing/archive/2012/04/12/10292868.aspx On the other hand, if I understood the RFC, this article is wrong. DNS name maximum string length should be 250 ASCII characters instead of 253 based on the following byte sequence which as per RFC1035 is maxed to 255 bytes: To simplify

When should an asterisk be encoded in an HTTP URL?

岁酱吖の 提交于 2019-11-28 22:50:46
According to RFC1738 , an asterisk (*) "may be used unencoded within a URL": Thus, only alphanumerics, the special characters "$-_.+!*'(),", and reserved characters used for their reserved purposes may be used unencoded within a URL. However, w3.org's Naming and Addressing material says that the asterisk is "reserved for use as having special signifiance within specific schemes" and implies that it should be encoded. Also, according to RFC3986 , a URL is a URI: The term "Uniform Resource Locator" (URL) refers to the subset of URIs that, in addition to identifying a resource, provide a means of

Java 8中的Base64编码和解码

霸气de小男生 提交于 2019-11-28 22:21:32
转自: https://juejin.im/post/5c99b2976fb9a070e76376cc Java 8会因为将lambdas,流,新的日期/时间模型和Nashorn JavaScript引擎引入Java而被记住。有些人还会记得Java 8,因为它引入了各种小但有用的功能,例如Base64 API。什么是Base64以及如何使用此API?这篇文章回答了这些问题。 什么是Base64? Base64 是一种二进制到文本编码方案,通过将二进制数据转换为基数-64表示,以可打印的 ASCII 字符串格式表示二进制数据。每个Base64数字恰好代表6位二进制数据。 Base64请求评论文件 在 RFC 1421 中首次描述了Base64(但没有命名) :Internet电子邮件的隐私增强:第一部分:消息加密和认证过程 。后来,它在 RFC 2045中 正式呈现为Base64 :多用途Internet邮件扩展(MIME)第一部分:Internet消息体的格式 ,随后在 RFC 4648:Base16,Base32和Base64数据编码中 重新访问。 Base64用于防止数据在传输过程中通过信息系统(例如电子邮件)进行修改,这些信息系统可能不是8-bit clean(它们可能是8位值)。例如,您将图像附加到电子邮件消息,并希望图像到达另一端而不会出现乱码