Community news, upcoming events and general discussions
Threads: 36 Posts: 88
Get technical support from the community
Threads: 1407 Posts: 7538
Threads: 18 Posts: 64
Tell us how to make XDK better!
Threads: 36 Posts: 119
Share and discuss community member projects
Threads: 78 Posts: 343
I'm trying to use the HttpExampleClient. I can successfully connect to my WiFi network and I also get the Ip adreess printed on the console but after that I'm getting this message:
40 [PIP:2] error in Get host IP by name -159.
Thanks in advance
Hello Lidia, the HttpExampleClient should work right out of the box. “error in get host IP by name” means that the XDK is unable to resolve the URL of your server. Please take a look at line 222 in HttpExampleClient.c.
PAL_getIpaddress((uint8_t*) "www.yourServer.com", &destAddr)
Make sure, that there is no typo in the URL www.yourServer.com. If this is not the case and the example still doesn’t work, please check that the DNS in your Wi-Fi network is working. Therefore, log in with a device of your choice, open a browser and try to resolve www.google.de. Please tell me, if you get it working. Kind regards, Manuel
Hello Lidia, www.posttestserver.com is a placeholder like www.yourServer.com. Nevertheless they both are valid and can be resolved. The HttpClientExample shows how to download a specific HTML file from a URL. Please check, if the DNS server is working in general in your network. Kind regards, Manuel
Thanks Manuel, problem solved!
Is there any restriction on the websites that can be donwloaded?
I've tried a few http websites but I either get the message "error occurred in downloading HTML" or I the html:
<html> <head> ... <body> <div class="page page-missing"> <h1>Site Not Found</h1> <p>Well, this is awkward. The site you're looking for is not here.</p> ... </body>
Hello Lidia, due to my knowledge, the URL needs to be resolvable and there must not be a redirect to https. Note that https is currently not supported of the XDK and therefore a HTML can not be requested via https. Please don't hesitate to open new threads for new topics. Kind regards, Manuel