zoukankan      html  css  js  c++  java
  • HTTP 1.1, 返回值100.

    HTTP 1.1支持只发送header信息(不带任何body信息),如果服务器认为客户端有权限请求服务器,则返回100,否则返回401。客户端如果接受到100,才开始把请求body发送到服务器。

    这样当服务器返回401的时候,客户端就可以不用发送请求body了,节约了带宽。

    另外HTTP还支持传送内容的一部分。这样当客户端已经有一部分的资源后,只需要跟服务器请求另外的部分资源即可。这是支持文件断点续传的基础。
    ---------------------
    作者:Sam哥哥
    来源:CSDN
    原文:https://blog.csdn.net/linsongbin1/article/details/54980801
    版权声明:本文为博主原创文章,转载请附上博文链接!

    If you are doing a POST, and the content length is 1,025 or greater, then curl exploits a feature of http 1.1: 100 (Continue) Status.

    See http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.2.3

    * it adds a header, "Expect: 100-continue". 
    * it then sends the request head, waits for a 100 response code, then sends the content

    Not all web servers support this though.  Various errors are returned depending on the server.  If this happens to you, suppress the "Expect" header with this command:

    <?php
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
    ?>

    http://www.php.net/manual/zh/function.curl-setopt.php#82418

  • 相关阅读:
    第六章 实验报告
    第三次实验报告
    第五章 循环结构课后反思
    第二次实验报告
    第一次实验报告
    第一次作业
    第九章
    指针实验报告
    第七次实验报告
    第六章
  • 原文地址:https://www.cnblogs.com/liujx2019/p/10287486.html
Copyright © 2011-2022 走看看