Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

ANT%20Interview%20Questions%20and%20Answers

Question: How to receive JSON Data at the Server Side?
Answer: • Read the JSON data as a String type
• Create JSONObject Java object from the string String json = readJSONStringFromRequestBody(request);
//Use the JSON-Java binding library to create a JSON object in Java JSONObject jsonObject = null;
try {
jsonObject = new JSONObject(json);
}
catch(ParseException pe) {
}
Is it helpful? Yes No

Most helpful rated by users:

©2024 WithoutBook