Solved

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

Posted on 2014-09-13
3
589 Views
Last Modified: 2014-09-15
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
Comment
Question by:Subbu P
3 Comments
 
LVL 20

Expert Comment

by:n2fc
ID: 40321178
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
 
LVL 12

Accepted Solution

by:
trinitrotoluene earned 500 total points
ID: 40321359
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
 

Author Comment

by:Subbu P
ID: 40324518
Thank you very much 'n2fc', actually your solution worked out finally.

Thanks a lot.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
maze travler 6 55
c++ getting the first 10 characters of a char* string 11 93
Digital Output does not have continuity to ground? 3 90
Using ANSI C how to Read a .csv file 10 79
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question