I have an example json as below:
{
“Passwd”:”String content”,
“Userme”:”String content”
}
how to construct the JSON String as above and give it as argument to HttpPost in Android.?
Can anyone help me in sorting out this issue.
thanks in Advance,
You can make use of
JSONObjectto create a simple json like{ "Passwd":"String content", "Userme":"String content" }try something like this.Above String can be sent as one of the parameter using HTTP POST easily. Below function takes url and json as parameters to make POST request.