Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 734
  • Last Modified:

Calling a web service using raw sockets from c/c++

Hi,

I would like to connect to a web service (http post) from c/c++ using raw sockets (not using wininet functions).

Any tips or a code sample is much appreciated, trying to figure out the possibility as well.

Thanks.
0
Subbu P
Asked:
Subbu P
1 Solution
 
n2fcCommented:
This was already answered in a prior question here at EE:
http://www.experts-exchange.com/Programming/Languages/C_Sharp/Q_20961335.html

However, the referenced code sample is no longer available...

Another example is available here:
http://www.codeproject.com/Articles/2487/Discover-WEB-HTTP-GET-POST-Utility

The newer article above has downloads available of the source code to do this, as well as completed sample project.

This looks like a good sample of exactly what you are looking for!

More info on raw sockets is also available here: (with sample code)
http://www.codeproject.com/Articles/8470/Network-Stuff-easy-socket-v
0
 
trinitrotolueneCommented:
My favourite for sockets has always been

http://beej.us/guide/bgnet/

But if you decide to go the REST way then give  Casablanca a try

Casablanca is a popular open source library which supports JSON parsing and has HTTP client APIs which shouldn't be too difficult to use.

Have a look here

Also if you have the time read what Herb Sutter has to say about it
0
 
Subbu PAuthor Commented:
Thank you very much 'n2fc', actually your solution worked out finally.

Thanks a lot.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now