2 xm7995230 xm7995230 于 2016.03.11 11:28 提问

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
xm7995230   2016.03.21 20:29

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

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!