微信支付沙箱测试错误 5C

接口: https://apitest.mch.weixin.qq.com/sandboxnew/pay/getsignkey

错误信息(json打印):
{"code":"204","status":"ERROR","responseline":"HTTP\/1.1 204 ERROR","headers":{"Server":"nginx","Date":"Sat, 31 Mar 2018 08:05:42 GMT","Content-Type":"text\/plain;charset=utf-8","Content-Length":"178","Connection":"close","from":"sandbox"},"content":false,"meta":"HTTP\/1.1 204 ERROR\r\nServer: nginx\r\nDate: Sat, 31 Mar 2018 08:05:42 GMT\r\nContent-Type: text\/plain;charset=utf-8\r\nContent-Length: 178\r\nConnection: close\r\nfrom: sandbox\r\n\r\n"}

这是怎样一回事?

1个回答

状态码204,在HTTP RFC 2616中关于204的描述如下:

If the client is a user agent, it SHOULD NOT change its document view from that which caused the request to be sent. This response is primarily intended to allow input for actions to take place without causing a change to the user agent’s active document view, although any new or updated metainformation SHOULD be applied to the document currently in the user agent’s active view.
意思等同于请求执行成功,但是没有数据,浏览器不用刷新页面.也不用导向新的页面。如何理解这段话呢。还是通过例子来说明吧,假设页面上有个form,提交的url为http-204.htm,提交form,正常情况下,页面会跳转到http-204.htm,但是如果http-204.htm的相应的状态码是204,此时页面就不会发生转跳,还是停留在当前页面。另外对于a标签,如果链接的页面响应码为204,页面也不会发生跳转。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问