views:

35

answers:

1

I'm trying to make requests to the shopify.com API over GAE python the url i have to request is not formed in the usual format.

it is composed like http://apikey:password@hostname/admin/resource.xml

with urllib I can request it but i cant set the headers for an xml request so it doesn't work.

urllib2, httplib... are having problems with the ':'.

I get either a 'nodename nor servname provided, or not known' or a 'nonnumeric port' because it expects a port number after the semicolon.

any help?

+2  A: 

Look into how to do HTTP Basic authentication in Python. See especially the section on Doing it Properly.

Will McCutchen
thank you but the problem here is that i have to access this exact url to access the API. the problem here is the colon.
aschmid00
The x:y@ isn't part of the hostname; it's just a way of doing the HTTP Basic authentication right in the URL instead of Doing It Properly.
Wooble
thank you for the clarification!
aschmid00