You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The SimpleOAuthClient example's access_resource() function uses POST, but
does not set the content-type. Some web servers (e.g. Tomcat) will not
identify that the content contains HTTP parameters unless the content-type
is set properly.
Something like this works for me:
def access_resource(self, oauth_request):
# via post body
# -> some protected resources
headers = { 'Content-Type' :'application/x-www-form-urlencoded' }
self.connection.request('POST', RESOURCE_URL,
body=oauth_request.to_postdata(), headers=headers)
response = self.connection.getresponse()
return response.read()
Original issue reported on code.google.com by jesse.my...@gmail.com on 27 Mar 2008 at 7:20
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
jesse.my...@gmail.com
on 27 Mar 2008 at 7:20The text was updated successfully, but these errors were encountered: