Hi Amir, You seem to be sending the authorization in the body of request, not in the headers. Including the basic auth in the headers of the URLFetch call should work.
-Marzia On Mon, Nov 24, 2008 at 9:47 AM, Amir Michail <[EMAIL PROTECTED]> wrote: > > > > On Nov 23, 1:31 pm, Amir Michail <[EMAIL PROTECTED]> wrote: > > On Nov 22, 5:35 pm, Amir Michail <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > > > I'm stuck on the authorization part: > > The bug here is sending the headers in the payload... > > Amir > > > > > Update: both the local and deployed versions result in an > > authentication failure. > > > > Any hints on how I could debug this? > > > > Amir > > > > > > > > > if self._username and self._password: > > > self._AddAuthorizationHeader(self._username, self._password) > > > print "self._request_headers = "+`self._request_headers` > > > > > requestBody = urllib.urlencode(self._request_headers) > > > url_data = urlfetch.fetch(url, > > > method=urlfetch.POST, > > > headers={'Content-type': > > > 'application/x-www-form- > > > urlencoded', > > > 'Content-Length': > > > str(len(requestBody))}, > > > payload=requestBody).content > > > > > This gives the following exception when a username and password are > > > supplied: > > > > > ...\src\twitter.py in NewFromJsonDict(data=u'request') > > > 547 else: > > > 548 status = None > > > 549 return User(id=data.get('id', None), > > > 550 name=data.get('name', None), > > > 551 screen_name=data.get('screen_name', None), > > > global User = <class 'twitter.User'>, builtin id = <built-in function > > > id>, data = u'request', data.get undefined, builtin None = None, name > > > undefined, screen_name undefined, location undefined, description > > > undefined, profile_image_url undefined, url undefined, status = None > > > <type 'exceptions.AttributeError'>: 'unicode' object has no attribute > > > 'get' > > > > > Any ideas how to get this to work? > > > > > Amir > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---