Does anyone have a working example of using HTTP via https to log into
Blogger and get an Authorization token for the ClientLogin model?
I am using the notes provided at
http://code.google.com/apis/blogger/docs/2.0/developers_guide_protoco...
but I am getting a 400 error, a badly formed request.
Interestingly enough, when I use a similar structure to unlock captcha
(/accounts/DisplayUnlockCaptcha?service=blogger), I am able to log in
without any errors and unlock captcha.
After unlocking the captcha, I am trying a subsequent login to obtain
the authorization token that I want to use to programatically perform
blogging actions, as required by Google in all subsequent headers.
The format of the string POST request I am sending to obtain the
authorization token is as shown below(actual email, passwords, etc,
have been changed of course.)
POST /accounts/ClientLogin? HTTP/1.1
Host: www.google.com
Content-type: application/x-www-form-urlencoded
Content-Length: 100
accountType=GOOGLE&Email=...@xxx.com&Passwd=xxxx&service=blogger&source=exampleCo-
exampleApp-1
----------------------------------------
Notes:
i)To unlock captcha, one has to Post to /accounts/UnlockCaptcha, even
though the initial request was to /accounts/DisplayUnlockCaptcha
ii)all lines are terminated in a CRLF, and a blank line also
corresponds to a CRLF(there is no --------------, it's just a
separator to make reading this posting easier)
iii)I tried to url encode the email, password, etc, but did not have
any success
iv)I tried to convert all characters from ASCII to uft-8 before url
encoding and then sending them, and did not have success either
v)I specified HTTP/1.1 so that the connection remains persistent. The
first/subsequent POST to unlock captcha succeeds/succeed(e.g. if the
wrong captcha is entered),
However the POST to request an Authorization token generates an HTTP/
1.0 400 Bad Request error.
Any tips will be appreciated.