JSON 面试题与答案
Question: How to Generate or Send JSON Data at the Server Side?Answer: Create JSON Java objectAdd name and value pairs using put method Convert it to String type using toString method and send it to the client with content-type as "text/xml" or "text/plain" myString = new JSONObject().put("JSON", "Hello, World!").toString(); // myString is {"JSON": "Hello, World"} |
保存以便复习
收藏此条目、标记为困难题,或将其加入复习集合。
这有帮助吗? 是 否
用户评价最有帮助的内容:
- Who is the Father of JSON ?
- What is the file extension of JSON?
- What is JSON?
- Why use JSON over XML?
- Explain JSON with php.