I have a string that is already in the proper URLEncoded Form format and would like to send it through a POST request on Android to a PHP server. I know the method for sending URL encoded forms on Android uses the UrlEncodedFormEntity
and I know how to use it. The problem with that is that the data comes into the function already URL encoded and joined by ampersands, so using UrlEncodedFormEntity
would involve a lot of extra work to turn it into a List
of NameValuePairs
and I'd rather not.
So, how do I make a proper POST request sending this string as the content body?
I have already tried using StringEntity
, but the PHP server didn't get any of the data (empty $_POST
object).
I am testing against http://test.lifewanted.com/echo.json.php which simply is
<?php echo json_encode( $_REQUEST );
Here is an example of the already-encoded data:
partnerUserID=email%40example.com&partnerUserSecret=mypassword&command=Authenticate