Solved

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

Posted on 2014-09-13
3
572 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
computer science syllabus 3 70
Exception thrown at 0x00007FFD5BC81F28 7 38
Path to  STL Map header file 1 41
Resolve Dependency Issues 4 44
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

911 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now