response = urlfetch.fetch(url, headers={'AUTHORIZATION' : authString})
if response.status_code == 200:
dom = minidom.parseString(response.content)
doc = dom.getElementsByTagName('token')[0]
guid = doc.getElementsByTagName('guid')[0].firstChild.data
This little chunk of code works perfect in my local environment, but
when I deploy it, the live version chokes with:
File "/base/data/home/apps/hootiehub/1.336752955878404037/
tweeple.py", line 17, in init_user
dom = minidom.parseString(response)
File "/base/python_dist/lib/python2.5/xml/dom/minidom.py", line
1923, in parseString
return expatbuilder.parseString(string)
File "/base/python_dist/lib/python2.5/xml/dom/expatbuilder.py", line
940, in parseString
return builder.parseString(string)
File "/base/python_dist/lib/python2.5/xml/dom/expatbuilder.py", line
223, in parseString
parser.Parse(string, True)
ExpatError: no element found: line 1, column 1
Any idea why it would work locally, but not in production?
Have you looked at what is in response.content under the two different
circumstances? The first thing that I would do is see if the urlfetch
is getting me two different sets of results in the two environments.
Why that would happen is very difficult to say without knowing what
resource is being retrieved, from where and what the body actually
looks like.
> Have you looked at what is in response.content under the two different
> circumstances? The first thing that I would do is see if the urlfetch
> is getting me two different sets of results in the two environments.
> Why that would happen is very difficult to say without knowing what
> resource is being retrieved, from where and what the body actually
> looks like.
Maybe have something to do with the url being https? It's returning a
URLFetchResult, but apparently nothing is in the "content"...
stumped. All works fine on my local machine.
On Oct 2, 2:41 pm, Uber Monjies <stir...@gmail.com> wrote:
> "response.content" is empty, but response =
> "<google.appengine.api.urlfetch._URLFetchResult object at
> 0xeec179be9ea79a60>"
> Is there some other way of cracking into that URLFetchResult object?
> Thanks again.
> On Oct 2, 1:44 pm, Adam <adam.crossl...@gmail.com> wrote:
> > Have you looked at what is in response.content under the two different
> > circumstances? The first thing that I would do is see if the urlfetch
> > is getting me two different sets of results in the two environments.
> > Why that would happen is very difficult to say without knowing what
> > resource is being retrieved, from where and what the body actually
> > looks like.
Logging the response.status_code shows a 401, which is unauthorized?!
I am using the exact same auth string from my local environment... is
there something specific to tweak for the production environment?
Thanks so much, this is driving me mad :)
On Oct 2, 2:45 pm, Uber Monjies <stir...@gmail.com> wrote:
> Maybe have something to do with the url being https? It's returning a
> URLFetchResult, but apparently nothing is in the "content"...
> stumped. All works fine on my local machine.
> On Oct 2, 2:41 pm, Uber Monjies <stir...@gmail.com> wrote:
> > Thanks...
> > "response.content" is empty, but response =
> > "<google.appengine.api.urlfetch._URLFetchResult object at
> > 0xeec179be9ea79a60>"
> > Is there some other way of cracking into that URLFetchResult object?
> > Thanks again.
> > On Oct 2, 1:44 pm, Adam <adam.crossl...@gmail.com> wrote:
> > > Have you looked at what is in response.content under the two different
> > > circumstances? The first thing that I would do is see if the urlfetch
> > > is getting me two different sets of results in the two environments.
> > > Why that would happen is very difficult to say without knowing what
> > > resource is being retrieved, from where and what the body actually
> > > looks like.
> Logging the response.status_code shows a 401, which is unauthorized?!
> I am using the exact same auth string from my local environment... is
> there something specific to tweak for the production environment?
> Thanks so much, this is driving me mad :)
> On Oct 2, 2:45 pm, Uber Monjies <stir...@gmail.com> wrote:
> > Maybe have something to do with the url being https? It's returning a
> > URLFetchResult, but apparently nothing is in the "content"...
> > stumped. All works fine on my local machine.
> > On Oct 2, 2:41 pm, Uber Monjies <stir...@gmail.com> wrote:
> > > Thanks...
> > > "response.content" is empty, but response =
> > > "<google.appengine.api.urlfetch._URLFetchResult object at
> > > 0xeec179be9ea79a60>"
> > > Is there some other way of cracking into that URLFetchResult object?
> > > Thanks again.
> > > On Oct 2, 1:44 pm, Adam <adam.crossl...@gmail.com> wrote:
> > > > Have you looked at what is in response.content under the two different
> > > > circumstances? The first thing that I would do is see if the urlfetch
> > > > is getting me two different sets of results in the two environments.
> > > > Why that would happen is very difficult to say without knowing what
> > > > resource is being retrieved, from where and what the body actually
> > > > looks like.