1. 1. 发送一个请求, 包含一个Expect:100-continue, 询问Server使用愿意接受数据
  2. 2. 接收到Server返回的100-continue应答以后, 才把数据POST给Server

这是libcurl的行为.
具体的RFC相关描述: http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.2.3
于是,这样就有了一个问题, 并不是所有的Server都会正确应答100-continue, 比如lighttpd, 就会返回417 "Expectation Failed", 则会造成逻辑出错,,
要解决的办法也挺容易:

    1. // Disable Expect: header (lighttpd does not support it)
    2. curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));

相关文章:

  • 2022-01-09
  • 2021-09-09
  • 2022-12-23
  • 2021-07-30
  • 2021-08-28
  • 2022-12-23
猜你喜欢
  • 2021-12-19
  • 2022-12-23
  • 2021-10-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-14
相关资源
相似解决方案