美文网首页实战问题
chrome浏览器ajax请求状态200,response为空的

chrome浏览器ajax请求状态200,response为空的

作者: 技术与健康 | 来源:发表于2018-01-10 21:31 被阅读232次

最近在测试服务器上经常出现前端发了ajax请求后,状态200,response为空,同时伴随着其他一些问题。不由得怀疑起来。在后端代码调试发现,后端服务返回了请求,发出了响应。那什么原因呢?

就想着能不能把请求拿出来发送一下。chrome还真有这个手段.
通过这种方式可以拿到如下的请求内容


image.png

然后在终端窗口去执行

例如:
curl -l -H "Content-type: application/json" -X POST -d '{"ver": "1.0","soa":

{"req":"123"},"iface":"me.ele.lpdinfra.prediction.service.PredictionService","method":"restaurant

_make_order_time","args":{"arg2":"\"stable\"","arg1":"{\"code\":

[\"WIND\"],\"temperature\":11.11}","arg0":"

{\"tracking_id\":\"100000000331770936\",\"eleme_order_id\":\"100000000331770936\",\"platfor

m_id\":\"4\",\"restaurant_id\":\"482571\",\"dish_num\":1,\"dish_info\":

[{\"entity_id\":142547763,\"quantity\":1,\"category_id\":1,\"dish_name\":\"[0xe7][0x89][0xb9]

[0xe4][0xbb][0xb7][0xe8][0x85][0x8a][0xe5][0x91][0xb3][0xe5][0x8f][0x89][0xe7][0x83][0xa7]

[0xe5][0x8f][0x8c][0xe6][0x8b][0xbc][0xe7][0x85][0xb2][0xe4][0xbb][0x94][0xe9][0xa5]

[0xad]\",\"price\":31.0}],\"merchant_location\":

{\"longitude\":\"121.47831425\",\"latitude\":\"31.27576153\"},\"customer_location\":

{\"longitude\":\"121.47831425\",\"latitude\":\"31.27576153\"},\"created_at\":1477896550,\"confir

med_at\":1477896550,\"dishes_total_price\":0.0,\"food_boxes_total_price\":2.0,\"delivery_total_

price\":2.0,\"pay_amount\":35.0,\"city_id\":\"1\"}"}}' http://vpcb-lpdinfra-stream-

1.vm.elenet.me:8989/rpc

相关文章

网友评论

    本文标题:chrome浏览器ajax请求状态200,response为空的

    本文链接:https://www.haomeiwen.com/subject/fvtonxtx.html