C++ REST SDK Sample on Galileo

513 views Asked by At

I would like to run the sample of C++ REST SDK posted in the Windows Developer Program site: https://ms-iot.github.io/content/Casablanca.htm

I was very careful to follow the steps, also using the version 2.2 of cpprest lib instead the latest one (2.4), the result is that I could run successfully the project and deploy it on my Galileo, but when the client object try to resolve the request using the sample posted in the page I received the following error:

Error exception:Error in: WinHttpSendRequest.

The code is the main.cpp in the link above, and I'm trying to run it in my Intel Galileo.

Appreciate any help because it's a bit frustrating can't find info about this error.

1

There are 1 answers

0
Dan Watts On

The most common cause of errors in the WinHttpSendRequest API are networking/DNS/firewall issues.

One easy thing to check is to ping www.bing.com from the Galileo (Telnet) command line. If that fails, then that's almost certainly the cause. You can replace www.bing.com with the IP address as a quick-and-dirty workaround.

If that's not it, is there a possibility that a firewall is blocking your request (e.g. if you are behind a corporate firewall)?

Did you run the code in the Visual Studio debugger? Can you narrow down where the exception occurs?

If that doesn't help and you're stuck, you might want to try the non-Casablanca approach: http://msdn.microsoft.com/en-us/library/windows/desktop/ms737889(v=vs.85).aspx. Personally, I find Casablanca's asynchronous structure to be confusing, and it's not of much benefit in my projects (basic HTTP client requests). Support for Winsock is packaged with the Windows image running on the Galileo, so no messy prereq configuration required.

Dan.