I am trying to do this...
I have a big object that I need to send from the backend to the view and from that view to other backend as parameter in a GET post. So, since I cannot send all the object, I thought about make it a very small string or a number, and for this I tried doing this.
First I converted the object to JSON
, using JSONObject
,but due the special characters I cannot take it as a normal string (it has many ", /, {},....
) so, I thought make it a byte, but I am not sure if is a correct approach, any idea how to do this?
Or something similar to have my object in an acceptable GET parameter for the URL.
So far I only have this code.
byte[] foo = new JSONObject(myObject).toString().getBytes();
String bar = foo.toString();
But dont know who to parse it back to byte and have not even tried to parse it back to JSON, any idea?
I am using spring and I dont have gson or jackson for convert to json an object.