Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2014-09-13
3
Medium Priority
?
699 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

705 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