I see what contain response. So something like this
l>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>replace</title>
<body>
<script language="JavaScript" type="text/javascript">
var pageName = '/';
if (('/' == pageName) || (pageName.indexOf('content.asp') != -1 )
|| (pageName.indexOf('mirror.asp') != -1)
|| (pageName.indexOf('insContent.asp') != -1)
|| (pageName.indexOf('ins2Content.asp') != -1)
|| (pageName.indexOf('content1.asp') != -1)
|| (pageName.indexOf('quicksetppp.asp') != -1)
|| (pageName.indexOf('quicksetwlan.asp') != -1)
|| (pageName.indexOf('quickconfig.asp') != -1))
{
top.location.replace(pageName);
}
else
{
top.contentfrm.location.replace(pageName);
}
</script>
</body>
</html>
response.getResponseBody()
You have to convert the array into a human readable string and see what's in there.
That's definitely not JSON, as you can probably see yourself.
Ok. I have response. I can create JsonReader from it.And from JsonReader I can get JsonObject.So if i correctly understood. I need JsonObject.
But when i try to read something from reader it will catch JsonException
Check this
You have provide a response which is NOT A JSON. How do you expect it to decode it?
I would recommend you think for a little before spamming this thread with more comments.
I try to explain how i understand this method.
First at all i call this :Context.getAsyncHttpClient().prepareGet(String.format(url, latitude, longitude))
Then i get response herepublic Object onCompleted(Response response)
So then I need to get Json from Response???
Thank you for your patience!!! I solved this problem. There is problem with url, so i change address to 192.168.1.4/nominatim/reverse.php. And it work. So it's only one problem why i can't put address as localhost
Is Nominatim on the same server as Traccar? I'm confused now because you've been telling that "localhost" worked and you provided some examples. Now you are saying that it doesn't.
Yes, nominatim is on the same server as Traccar. When I say that nominatim work at localhost I mean, that I could reverse geocoding through browser.So I don't know why ning async http client show me status 200(OK)
and JsonException
when I use localhost and status 200(OK)
and address in database when I use 192.168.1.2/nominatim/reverse.php
. But as a suitable solution I can make static ip address at computer.
So, did you use "localhost" in the browser?
Yes, when I try to connect to nominatim at computer with servers.
I'm not sure what you are evaluating, but you need some code to convert an array into string. That's what I meant.