xm7995230 2016-03-11 03:28 采纳率: 0%
浏览 2254

Django 接入微信post方法时报错

code 400, message Bad request syntax ('\x00\xb3\x02\x00\x0c\x00QUERY_STRINGW\x00signature=a78c2ca4ca9a2594bf54fdda6727e9bf1151229a&timestamp=1457662563&nonce=755200386\x0e\x00REQUEST_METHOD\x04\x00POST\x0c\x00CONTENT_TYPE\x08\x00text/xml\x0e\x00CONTENT_LENGTH\x03\x00318\x0b\x00REQUEST_URIf\x00/wechat_access?signature=a78c2ca4ca9a2594bf54fdda6727e9bf1151229a&timestamp=1457662563&nonce=755200386\t\x00PATH_INFO\x0e\x00/wechat_access\r\x00DOCUMENT_ROOT\x15\x00/usr/share/nginx/html\x0f\x00SERVER_PROTOCOL\x08\x00HTTP/1.0\x0c\x00UWSGI_SCHEME\x04\x00http\x0b\x00REMOTE_ADDR\x0e\x00182.254.86.156\x0b\x00REMOTE_PORT\x05\x0042845\x0b\x00SERVER_PORT\x02\x0080\x0b\x00SERVER_NAME\x0b\x00bfy.sozi.it\x0c\x00UWSGI_SCHEME\x04\x00http\x0f\x00SERVER_SOFTWARE\x0b\x00nginx/1.4.6\x0f\x00HTTP_USER_AGENT\x0b\x00Mozilla/4.0\x0b\x00HTTP_ACCEPT\x03\x00*/*\t\x00HTTP_HOST\x0b\x00bfy.sozi.it\x0b\x00HTTP_PRAGMA\x08\x00no-cache\x13\x00HTTP_CONTENT_LENGTH\x03\x00318\x11\x00HTTP_CONTENT_TYPE\x08\x00text/xml<![CDATA[gh_f24247160fad]]>')

Exception happened during processing of request from ('127.0.0.1', 34316)
Traceback (most recent call last):
File "/usr/lib/python2.7/SocketServer.py", line 593, in process_request_thread
self.finish_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/local/lib/python2.7/dist-packages/django/core/servers/basehttp.py", line 129, in init
super(WSGIRequestHandler, self).__init__(*args, **kwargs)
File "/usr/lib/python2.7/SocketServer.py", line 649, in init
self.handle()
File "/usr/lib/python2.7/wsgiref/simple_server.py", line 117, in handle
if not self.parse_request(): # An error code has been sent, just exit
File "/usr/lib/python2.7/BaseHTTPServer.py", line 286, in parse_request
self.send_error(400, "Bad request syntax (%r)" % requestline)
File "/usr/lib/python2.7/BaseHTTPServer.py", line 368, in send_error
self.send_response(code, message)
File "/usr/lib/python2.7/BaseHTTPServer.py", line 385, in send_response
self.log_request(code)
File "/usr/lib/python2.7/BaseHTTPServer.py", line 422, in log_request
self.requestline, str(code), str(size))
File "/usr/local/lib/python2.7/dist-packages/django/core/servers/basehttp.py", line 136, in log_message
msg = "[%s] %s\n" % (self.log_date_time_string(), format % args)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xb3 in position 2: ordinal not in range(128)

  • 写回答

1条回答

  • xm7995230 2016-03-21 12:29
    关注

    注意微信服务器上的设置,URL最后的/存不存在

    评论

报告相同问题?

悬赏问题

  • ¥65 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥200 uniapp长期运行卡死问题解决
  • ¥15 latex怎么处理论文引理引用参考文献
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?