开发者社区> 问答> 正文

post请求后,无返回信息,是怎么回事呢?? 400 报错

post请求后,无返回信息,是怎么回事呢?? 400 报错

@hongliuliao 你好,想跟你请教个问题:post请求后,无返回信息,是怎么回事呢?

2015-10-20 19:47:11.778 DEBUG /home/develop/httpserver/epoll_socket.cpp(71): server: got connection from 172.18.20.193

2015-10-20 19:47:11.778 DEBUG /home/develop/httpserver/epoll_socket.cpp(84): get accept socket which listen fd:3, conn_sock_fd:5
2015-10-20 19:47:11.779 DEBUG /home/develop/httpserver/epoll_socket.cpp(116): read success which read size:172
2015-10-20 19:47:11.779 DEBUG /home/develop/httpserver/http_parser.cpp(199): read from client: size:172, content:POST /sayhello HTTP/1.1
Host: 172.18.20.195
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.4 (Java 1.5 minimum; Java/1.7.0_75)
Accept-Encoding: gzip,deflate




2015-10-20 19:47:11.779 DEBUG /home/develop/httpserver/http_parser.cpp(224): start parse req_line line:POST /sayhello HTTP/1.1
2015-10-20 19:47:11.779 DEBUG /home/develop/httpserver/http_parser.cpp(85): start parse params which request_url:/sayhello
2015-10-20 19:47:11.779 DEBUG /home/develop/httpserver/http_parser.cpp(231): parse_request_line success which method:POST, url:/sayhello, http_version:HTTP/1.1
2015-10-20 19:47:11.779 DEBUG /home/develop/httpserver/http_parser.cpp(242): start PARSE_REQ_HEAD line:Host: 172.18.20.195
2015-10-20 19:47:11.779 DEBUG /home/develop/httpserver/http_parser.cpp(242): start PARSE_REQ_HEAD line:Connection: Keep-Alive
2015-10-20 19:47:11.779 DEBUG /home/develop/httpserver/http_parser.cpp(242): start PARSE_REQ_HEAD line:User-Agent: Apache-HttpClient/4.4 (Java 1.5 minimum; Java/1.7.0_75)
2015-10-20 19:47:11.779 DEBUG /home/develop/httpserver/http_parser.cpp(242): start PARSE_REQ_HEAD line:Accept-Encoding: gzip,deflate
2015-10-20 19:47:11.779 ERROR /home/develop/httpserver/http_parser.cpp(269): parse request no over parse_part:2, line_info:method:POST,request_url:/sayhello,http_version:HTTP/1.1


展开
收起
爱吃鱼的程序员 2020-05-30 23:46:56 741 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    引用来自“iywin”的评论

    POST消息,无数据的时候,卡起了。
    post的支持已经加上了,请更新最新代码,但是要求必须要有Content-Length 和 这个header, 另外要解析出post的参数需要加 Content-Type: application/x-www-form-urlencoded 参数######

    在post请的body中加上 数据后,就出现如下提示

    2015-10-20 20:40:14.877 DEBUG /home/develop/Balancer/httpserver/http_parser.cpp(184): READ REQUEST NOT OVER!

    浏览器的链接已经保存链接不会关闭。




    ######POST:消息结束标志位判断出错!!######POST消息,无数据的时候,卡起了。######

    引用来自“iywin”的评论

    POST消息,无数据的时候,卡起了。
    嗯,现在对Post的支持不是很好,所以在新版本中暂时去掉了,正在考虑加上, 另外,你的post方法中好像没有指定Content-Length######哦!好的 谢谢
    2020-05-30 23:46:58
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载