Solved

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

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

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
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 how to create, access, and change arrays in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

757 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

18 Experts available now in Live!

Get 1:1 Help Now