Facebook Httperror Http Error 400 Bad Request
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the
Http Error 400 Bad Request Request Too Long
workings and policies of this site About Us Learn more about http error 400 bad request python Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions urllib2.httperror http error 400 bad request json Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.
Python 3 Urllib.error.httperror Http Error 400 Bad Request
Join them; it only takes a minute: Sign up Facebook publish HTTP Error 400 : bad request up vote 0 down vote favorite Hey I am trying to publish a score to Facebook through python's urllib2 library. import urllib2,urllib url = "https://graph.facebook.com/USER_ID/scores" data = {} data['score']=SCORE data['access_token']='APP_ACCESS_TOKEN' data_encode = urllib.urlencode(data) request = urllib2.Request(url, data_encode) response = urllib2.urlopen(request) responseAsString =
Response 400 Python Requests
response.read() I am getting this error: response = urllib2.urlopen(request) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 124, in urlopen return _opener.open(url, data, timeout) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 389, in open response = meth(req, response) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 502, in http_response 'http', request, response, code, msg, hdrs) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 427, in error return self._call_chain(*args) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 361, in _call_chain result = func(*args) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 510, in http_error_default raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) urllib2.HTTPError: HTTP Error 400: Bad Request Not sure if this is relating to Facebook's Open Graph or improper urllib2 API use. python facebook-graph-api urllib2 facebook-opengraph share|improve this question asked Jun 28 '12 at 8:37 Abhishek 58341734 2 what's in the body of the error? –Igy Jun 28 '12 at 8:39 Seriously though, there should be an error from Facebook's side in the body of the error –Igy Jun 28 '12 at 9:26 add a comment| 2 Answers 2 active oldest votes up vote 0 down vote accepted I ran your code and got the same error (there is no more error in
here for a quick overview of the site Help Center Detailed answers to any questions you might have raise httperror(req.get_full_url(), code, msg, hdrs, fp) Meta Discuss the workings and policies of this site About Us
Raise Httperror Req Full_url Code Msg Hdrs Fp Urllib Error Httperror Http Error 400 Bad Request
Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads urllib2 quote with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, http://stackoverflow.com/questions/11240920/facebook-publish-http-error-400-bad-request just like you, helping each other. Join them; it only takes a minute: Sign up urllib2 HTTP Error 400: Bad Request up vote 12 down vote favorite 5 I have a piece of code like this host = 'http://www.bing.com/search?q=%s&go=&qs=n&sk=&sc=8-13&first=%s' % (query, page) req = urllib2.Request(host) req.add_header('User-Agent', User_Agent) response = urllib2.urlopen(req) and when I input a query http://stackoverflow.com/questions/8840303/urllib2-http-error-400-bad-request greater than one word like "the dog" i get the following error. response = urllib2.urlopen(req) File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen return _opener.open(url, data, timeout) File "/usr/lib/python2.7/urllib2.py", line 400, in open response = meth(req, response) File "/usr/lib/python2.7/urllib2.py", line 513, in http_response 'http', request, response, code, msg, hdrs) File "/usr/lib/python2.7/urllib2.py", line 438, in error return self._call_chain(*args) File "/usr/lib/python2.7/urllib2.py", line 372, in _call_chain result = func(*args) File "/usr/lib/python2.7/urllib2.py", line 521, in http_error_default raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) urllib2.HTTPError: HTTP Error 400: Bad Request Can anyone point out what im doing wrong? Thanks in advance. python urllib2 http-error share|improve this question asked Jan 12 '12 at 18:27 PyFan 66115 I've also received "urllib2.HTTPError: HTTP Error 406: Not Acceptable" when attempting to request URLs with whitespace. –jamesc Oct 5 '12 at 9:27 add a comment| 4 Answers 4 active oldest votes up vote 48 down vote accepted The reason that "the dog" returns a 400 Error is because you aren't escaping the string for a
Sign in Pricing Blog https://github.com/colinhowe/pyFaceGraph/issues/2 Support Search GitHub This repository Watch 142 Star 2,499 Fork 1,101 omab/python-social-auth Code Issues 232 Pull requests 36 Projects 0 Pulse Graphs New issue HTTPError at http error /complete/facebook/ when trying to connect to Facebook. #207 Closed psych0der opened this Issue Mar 5, 2014 · 13 comments Projects None yet Labels None yet Milestone No milestone Assignees No http error 400 one assigned 3 participants psych0der commented Mar 5, 2014 I am keep getting this 400 Client Error: Bad Request whenever I try to connect to Facebook through python social auth. I have entered correct parameter in Facebook app settings ( localhost:8000 as site URL). Here's the exception stack : HTTPError at /complete/facebook/ 400 Client Error: Bad Request Request Method: GET Request URL: http://localhost:8000/complete/facebook/?redirect_state=znj2c5EEL42tSm7bteQF2HtgOFyDKEDD&code=AQBeVfYEcNM6ehAVgfOLx3B1GHEu48-V8zRh8l-pLvo8Kn43_x85XvFwVDsXsG1i7UWoA56zgbPNKmCMS7veZV85aamR_unPH1lTGmI3H18tf_CiAuLP9kMyDdeumIPtQeIkOnSO6BCivIVfp1TwezoQlpR8Dwksh8aZ389GzEcXeAhf28fzWU9YYs52sIg8zbJ-CQjFk18igGrpj0Iz4Agzxe1LyaiYtOAB8wxkzbfgVYm7s9FBYSKZ-Y0O5OiNTx5-8t0fEcYs2tu2YwssP9A6nXyM58bLWZmVyFZqmbILJxI8yP-dbJ_SkWn0sVFUVxc&state=znj2c5EEL42tSm7bteQF2HtgOFyDKEDD Django Version: 1.5.5 Exception Type: HTTPError Exception Value: 400 Client Error: Bad Request Exception Location: /Users/mayankbhola/nobles0ul_progr/venvs/resumizr/lib/python2.7/site-packages/requests/models.py in raise_for_status, line 773 Python Executable: /Users/mayankbhola/nobles0ul_progr/venvs/resumizr/bin/python Python Version: 2.7.6 Python Path: ['../..', '/Users/mayankbhola/Downloads/python-social-auth-master/examples/django_example', '/Users/mayankbhola/nobles0ul_progr/venvs/resumizr/lib/python2.7/site-packages/mongoengine-0.8.7-py2.7.egg', '/Users/mayankbhola/nobles0ul_progr/venvs/resumizr/lib/python2.7/site-packages/pymongo-2.6.3-py2.7-macosx-10.9-x86_64.egg', '/Users/mayankbhola/nobles0ul_progr/venvs/resumizr/lib/python27.zip', '/Users/mayankbhola/nobles0u
Sign in Pricing Blog Support Search GitHub This repository Watch 9 Star 86 Fork 20 colinhowe/pyFaceGraph Code Issues 7 Pull requests 1 Projects 0 Pulse Graphs New issue Error 400: Bad Request #2 Closed deecodameeko opened this Issue Nov 18, 2010 · 4 comments Projects None yet Labels None yet Milestone No milestone Assignees No one assigned 5 participants deecodameeko commented Nov 18, 2010 I was able to use pyFaceGraph to post a test message to my feed in the python interpreter. I then tried to send another message, the exact same one, and got the following: Traceback (most recent call last): File "", line 1, in File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pyfacegraph-0.0.4-py2.6.egg/facegraph/graph.py", line 157, in call data = json.loads(self.fetch(self.url | params)) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pyfacegraph-0.0.4-py2.6.egg/facegraph/graph.py", line 203, in fetch conn = urllib2.urlopen(url, data=data) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 126, in urlopen return _opener.open(url, data, timeout) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 397, in open response = meth(req, response) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 510, in http_response 'http', request, response, code, msg, hdrs) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 435, in error return self._call_chain(args) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 369, in _call_chain result = func(args) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py", line 518, in http_error_default raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) urllib2.HTTPError: HTTP Error 4