I want to send my data to server in the form of Json, I have written coding part which will send my data in the form of Json now I want to test this code. Now the problem is at present my server side code is not complete so how do I so it. I want to send three strings to the server side and I have used this link to convert the output in form of Json. Android JSON HttpClient to send data to PHP server with HttpResponse Thanks in advance
4
-
I have written in this form StringEntity s = new StringEntity(c.toString()); s.setContentEncoding(new BasicHeader(HTTP.CONTENT_TYPE, "application/json")); where c is JSONObjectprateek– prateek2012-01-17 12:39:24 +00:00Commented Jan 17, 2012 at 12:39
-
I don't get it, JSONObject class is supposed to generate the JSON output correctly everytime you call toString(). Thats if you added the values. Like: JSONObject c = new JSONObject(); c.put("string1", "prateek"); c.put("string2", "me"); c.put("string3", "you"); string finalJson = c.toString();WoLfulus– WoLfulus2012-01-17 12:44:20 +00:00Commented Jan 17, 2012 at 12:44
-
when you print "j.toString()" ?WoLfulus– WoLfulus2012-01-17 12:49:30 +00:00Commented Jan 17, 2012 at 12:49
-
@WoLfulus JSONObject class is generating the JSON output correctly what i want is to check weather my rest of the code which I have taken from this link <Android JSON HttpClient to send data to PHP server with HttpResponse> is working or not so how to do it. and sorry for above comment it was my mistake, i have not putted any data in strings tht why it was showing only curl bracesprateek– prateek2012-01-17 12:57:54 +00:00Commented Jan 17, 2012 at 12:57
Add a comment
|