CURL POST大数据和lighttpd出现的…
来源:互联网 发布:乐视网络电视直播 编辑:程序博客网 时间:2024/05/21 14:52
- 作者: laruence(http://www.laruence.com)
- 本文地址: http://www.laruence.com/2011/01/20/1840.html
- 转载请注明出处
在使用curl做POST的时候, 当要POST的数据大于1024字节的时候, curl并不会直接就发起POST请求,而是会分为俩步,
-
1. 发送一个请求,包含一个Expect:100-continue, 询问Server使用愿意接受数据 -
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”, 则会造成逻辑出错,,
要解决的办法也挺容易:
-
curl_setopt($ch,CURLOPT_HTTPHEADER, array('Expect:')); -
//Disable Expect: header (lighttpd does not support it)
阅读全文
0 0
- CURL POST大数据和lighttpd出现的…
- curl http post 数据和图片
- 用curl进行post数据出现Expect: 100-continue错误
- 使用PHP CURL的POST数据
- curl POST的数据大于1024字节
- 使用PHP CURL的POST数据
- 使用PHP CURL的POST数据
- php curl post数据的问题
- CURL POST 数据
- php的curl实现get和post
- php的curl实现get和post
- php的curl实现get和post
- CURL的get和post请求,简单明了
- 关于Curl的get和post请求
- PHP使用CURL向服务器POST文本数据和上传图片的代码示例
- linux下的 lighttpd 与框架 thinkp…
- perl和curl 模拟post 发送json数据
- 使用curl命令post数据
- oracle 重启
- JAVA 上加密算法的实现用例
- 自己做的网站再次开张www.fireidea…
- php里面比较恶搞的FALSE和false
- Ehcache缓存配置【转】
- CURL POST大数据和lighttpd出现的…
- 今天碰到的土鳖事情,关于explode
- 一位ACM过来人的心得
- linux sed命令
- 大学时候在linux下用c++的一个小测…
- mysql 优化
- No row with the given identifier exists: [com.wanmei.entity.TableMeta#3219]
- jvm内存知识
- centos7安装redis3.2.5集群