Topic: Problem with JSON in java
I have a problem with a JSON format this is my code:
public void Datos(String id){
long idLg = Long.parseLong(id);
long flagLg = 8389633;
JsonObject recibejson = new JsonObject();
recibejson.addProperty("id", idLg);
recibejson.addProperty("flags", flagLg);
//recibejson = recibejson+"&sid=026cc36f88a8c46099a3ff3e48eace36";
//System.out.println("JSON: " + recibejson + "&sid="+);
//return recibejson.toString();
RemoteHttpClient remoteHttpClient = RemoteHttpClient.getInstance();
remoteHttpClient.remoteCall("core/search_item", recibejson, new ResponseHandler(){
//url="core/search_item"+
//remoteHttpClient.remoteCall(url, new ResponseHandler(){
@Override
public void onSuccess(String response)
{
System.out.println("Esto es lo que recibe");
}
@Override
public void onFailure(int errorCode, Throwable throwableError) {
super.onFailure(errorCode, throwableError);
// search item failed, print error
System.out.println(Errors.getErrorText(errorCode));
}
});
The problem is that as I can attach the "SID" so that I get back the answer according to this example:
"https://hst-api.wialon.com/wialon/ajax.html?svc=core/search_item&
params={
"id":34868,
"flags":1025
}&sid=<your_sid>;"
Suggest or coments please.