HttpExampleClient
Answer
9/7/18 5:41 AM

Hello Everyone,

I am testing the HttpExampleClient example.

I have some error to use the Post function.

I use the localhost Webserver to teste. Could you advice how to do?

 

0 (0 Votes)
RE: HttpExampleClient
Answer
9/7/18 1:27 PM as a reply to Choi Goeun.
Hello Choi,

The error you are getting is pointing to the error RC_HTTP_SEND_ERROR , which indicates that the HTTP request cannot be sent out.

This can have multiple reasons. One of them would be that your XDK is not connected to your local Wi-Fi network. The other one would be that your HTTP server is not reachable.

I assume that here applies the second reason, that your HTTP server is not reachable. In that regard could you please provide the outline where you configure the server address and the port where the XDK should send data to?

Please let me know if this was helpful and feel free to ask if you have further questions.

Kind regards,
Franjo
0 (0 Votes)
RE: HttpExampleClient
Answer
9/17/18 3:21 AM as a reply to Franjo Stjepandic.

Hello Franjo,

I test the two type of web server again.

 

1) Localhost web server : localhost:3000

2) hosting web server : http://goeun.herokuapp.com/

 

But, I have some both of same error

11[PIP:2] error in Get host IP by name -172

 

Could you advice error?

0 (0 Votes)
RE: HttpExampleClient
Answer
9/17/18 1:11 PM as a reply to Choi Goeun.
Hello Choi,

Thank you for providing further information on your issue.

The error you are getting is simply stating, that the DNS request performed by the XDK to resolve the IP address from the domain name is failing.

In regards to your first own notebook as HTTP server, you configured in the field DEST_SERVER_HOST the destination IP address with an additional / . This backslash is an indication for a URI and should be removed because it might be the cause, why the underlying DNS request is failing.

In regards to your other web server, I am, unfortunately, also not able to reach it and this might be the fact why the DNS request is failing as well. Am I right, that this is an internal website, not reachable over the internet? If that is correct, then this might be the cause, why the XDK is here unable to get a successful DNS response with a corresponding IP address.

On that behalf, it would be helpful if you could try to ping http://goeun.herokuapp.com/   to see if you get with your notebook a response from the webpage.

Otherwise, have you tried a different web server as postman-echo.com or httpbin.org out as well?

Please let me know if this was helpful and feel free to ask if you have further questions.

Kind regards,
Franjo
0 (0 Votes)
RE: HttpExampleClient
Answer
9/18/18 1:29 AM as a reply to Franjo Stjepandic.

Hello,

Thanks so much you replying.

 

1) Regrading the my localhost web server,

I added the destination IP address with an additional / . but it is failed.

Is it possible to request the local web server?

 

2) Thanks so much you guide web server as postman-echo.com.

I could test the postman-echo.com. but it has the same error.

Could you advice please?TT

 

 

0 (0 Votes)
RE: HttpExampleClient
Answer
9/18/18 3:06 PM as a reply to Choi Goeun.
Hello Choi,

I am always glad to help.
Most likely, the error seems to be caused by the additional path (URI) you inserted in the URL:
 
  • The written /, when trying to use your own server
  • The additional /get, when using postman-echo.com
Further, for these informations, the fields DEST_GET_PATH and DEST_POST_PATH are prepared in the HttpExampleClient example.

In regards to your own server, using localhost as destination URL will not work.
This is used to access the hosts, in your case your own notebooks/pcs, running network services by bypassing any local network interfaces.
To establish a successful connection via HTTP to the XDK, you need to insert the correct IP address of your own notebook/pc.

Please let me know if this was helpful and feel free to ask if you have further questions.

Kind regards,
Franjo
0 (0 Votes)
RE: HttpExampleClient
Answer
9/19/18 11:23 AM as a reply to Franjo Stjepandic.

Hello Franjo,

Thank you :-)

 

1) Regarding the localhost server,

I tried the the "ipadress:3000"

Is it right to wrote "ipadress/3000"?

 

2) Regarding the postman-echo

you mean that, Is it right the below vlaue?

DEST_SERVER_HOST  "http://postman-echo.com"

DEST_POST_PATH "/get"

0 (0 Votes)
RE: HttpExampleClient
Answer
9/20/18 7:41 AM as a reply to Choi Goeun.
Hello Choi,

This looks way better.

To come to your points:
 
  1. The #define DEST_SERVER_HOST "192.168.0.11:3000" is absolutely correct and should work XDK sided.
    The linked port behind the ip address, in your case port 3000, requires the character : right before the port number itself, to announce the port, instead of this character /, which would expand a path.
    If this does not work, the issue locates probably within the DNS configuration of your Wi-Fi network.
    In this case, open your router's Wi-Fi settings and edit your DNS configuration to allow the XDK to communicate.
     
  2. Your provided code lines, regarding the postman echo look fine, too.
    Keep in mind, a DEST_POST_PATH path like in your latest screenshot is not required for the execution of DNA requests.
Please tell me if this was helpful, and do not hesitate to ask further questions.

Kind regards,
Franjo
0 (0 Votes)