GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Reverse Geocoding Webservices : Country  XML
Forum Index -> General
Author Message

Joined: 19/09/2018 16:50:44
Messages: 1

trying to find the ISO country code for the given lat/lng.

I didn't get a String . I get an error "Unexpected character" and I can not inser the response in my database ! using this method:** I thought we get a text as response !

I've certainly missed something?
here is my code :

Http h = new Http();
HttpRequest req = new HttpRequest();
req.setHeader('Content-Type', 'text/html');
HttpResponse res = h.send(req);
System.debug('country' + res.getBody());
String Country = (String)res.getBody();
System.debug('the return value is'+Country);

ISOContry__c cs = ISOContry__c.getInstance(string.valueOf(res.getBody()));
System.debug (' the A3 '+ cs.A3__c);
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team