Answer the question
In order to leave comments, you need to log in
How to transfer JSON from java servlet to mobile client on SWIFT?
Good day!
There is a Restful service, a web server and JAVA servlets. There is a mobile client on SWIFT.
Data is exchanged using json.
I got the data necessary for the user from the database, formed JSONObject (object id).
Could you tell me how then to send JSONObject to the client? Should it be encoded into bytes?
Or is JSONOblect not required here?
Thank you.
Answer the question
In order to leave comments, you need to log in
As a first approximation, it will look something like this
HttpServletResponse response;
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json; charset=UTF-8");
PrintWriter writer = response.getWriter();
writer.print(...);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question