2

Where can I see an example of HTTP POST request using boost::asio?

I've only saw some examples with HTTP GET requests.

FrozenHeart
  • 19,844
  • 33
  • 126
  • 242
  • It would be nice to link the tutorial, so we can look in to it. In this example http://www.boost.org/doc/libs/1_49_0/doc/html/boost_asio/example/http/client/sync_client.cpp It seems like you write the http request yourself, so you can write POST instead of GET. Check out how http requests are formed and how you append parameters/arguments to your post request and so on. – xeed Oct 24 '13 at 10:44
  • Look for C++ REST SDK. Is a C++ framework for REST service the http protocol is arleady implemented. http://casablanca.codeplex.com/ – Elvis Dukaj Oct 24 '13 at 12:48

1 Answers1

0

Look at this http request header for example:

POST /path/script.cgi HTTP/1.0
From: test@tests.com
User-Agent: HTTPTool/1.0
Content-Type: application/x-www-form-urlencoded
Content-Length: 32

argument1=text&argument2=arg2text

Check out the get example and change the request to this. Probably alter whatever you think should be altered

xeed
  • 925
  • 8
  • 22