Unabled to request an OAth token with Apache HttpClient on Android

Asked by Christopher Perrin

I'm trying to get an OAuth request token as described here: https://help.launchpad.net/API/SigningRequests

If I use the tool Fiddler to send a raw HTTPS request everything works fine for me and I get a token, but if I use the Apache HTTPClient lib for Java I get a 401 Unauthorized.

I debuged my request and this is what I got:

>> "POST /+access-token HTTP/1.1[EOL]"
>> "Content-Length: 76[EOL]"
>> "Content-Type: application/x-www-form-urlencoded; charset=UTF-8[EOL]"
>> "Host: edge.launchpad.net[EOL]"
>> "Connection: Keep-Alive[EOL]"
>> "[EOL]"
>> "oauth_consumer_key=test&oauth_signature_method=PLAINTEXT&oauth_signature=%26"

<< "HTTP/1.1 401 Unauthorized[EOL]"
<< "Date: Thu, 13 May 2010 10:22:46 GMT[EOL]"
<< "Server: zope.server.http (HTTP)[EOL]"
<< "X-Powered-By: Zope (www.zope.org), Python (www.python.org)[EOL]"
<< "X-Content-Type-Warning: guessed from content[EOL]"
<< "Content-Length: 0[EOL]"
<< "Vary: Cookie,Authorization,Accept-Encoding[EOL]"
<< "Content-Type: text/plain;charset=utf-8[EOL]"
<< "WWW-Authenticate: OAuth realm="https://api.launchpad.net"[EOL]"
<< "Via: 1.1 edge.launchpad.net[EOL]"
<< "Keep-Alive: timeout=15, max=100[EOL]"
<< "Connection: Keep-Alive[EOL]"
<< "[EOL]"

I can't see anything wrong in my Request. Maybe someone else can.

Question information

Language:
English Edit question
Status:
Solved
For:
Launchpad itself Edit question
Assignee:
No assignee Edit question
Solved by:
Christopher Perrin
Solved:
Last query:
Last reply:
Revision history for this message
Christopher Perrin (cperrin88) said :
#1

POST /+access-token -> POST /+request-token