Possible duplicate:
How to send a JSON object via Request from Android?
Since I am new to Android development, I am faced with the problem of sending requests to a web service in the form of JSON. Googling, I found the following code to send requests using parameters. Here is the Java class we are sending as:
Main.java
RestClient client = new RestClient(LOGIN_URL); client.AddParam("Email", _username); client.AddParam("Passwd", _password); try { client.Execute(RequestMethod.POST); } catch (Exception e) { e.printStackTrace(); } String response = client.getResponse();
But here I want to send parameters in a JSON form, for example, for example, I want to send parameters in this form:
{ "login":{ "Email":_username, "Passwd":_password, } }
So can anyone help me? How to send parameters in JSON form?
user1578518
source share