I am trying to send the following data to server
{"feedback":{"q1":12.0, "q2":33, "q3":12.0, "q4":78, "q5":12.0, "q6":33, "q7":12.0, "q8":33, "q9":12.0, "q10":33, "latitude":12.0, "longitude":33.08, "imei":128790, "time":"base64string"}}
I am unable to create a proper jsoup String. i am able to connect to my server but when i try to send the following information using POST
request. it fails.
I tried to send the same request through my WEB CONSOLE, and it worked fine there as well.
Below is my code:
protected String doInBackground(String... urls) {
try {
// Connect to the web site
Document document = Jsoup.connect("http://107.170.91.100/books/save_feedback")
.data("q1", q1).data("q2", q2).data("q3", q3).data("q4", q4).data("q5", q5).data("q6", q6).data("q7", q7).data("q8", q8)
.data("q9", q9).data("q10", q10)
.data("latitude", "234").data("longitude", "344.4").data("imei", ime)
.data("time", MainActivity.b64)
.post();
//String title = document.title();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
What am i missing here? i guess the format of my data in which i am sending is incorrect. do i need to add the word feedback in the data as well? Any help would be appreciated