Thanks a lot Robert!
I was already populating the parameters/values that way (after a lot of hit and trial errors Image may be NSFW.
Clik here to view. ) but I still had the content type as 'text'. I changed it to 'application/form'. That made all the difference! For testing, right now I am just manually concatenating all the parameter/value pairs into a string. Did not use escape_url method.
Though I am getting a different kind of error now which I suspect is from the HTTP service side.