create a RESTful web service sample

May 1, 2015 at 8:41 PM
I was looking through the samples provided with the SDK, but couldn't find any as to how to create a RESTful service. So, can anyone guide me where I can find some samples to get started in creating a service using C++ REST SDK.
Thanks in advance.. :)
May 1, 2015 at 8:44 PM

Hi RakiHexCode,

The C++ REST SDK is really focused on connecting to REST services, not so much on authoring them. We have a http_listener class which can be used to create a primitive HTTP server.

For more information on the http_listener take a look at:

· reference documentation

· CasaLen http_listener sample

· BlackJack server sample


May 2, 2015 at 6:14 AM
Thanks for your reply Steve
May 3, 2015 at 5:50 PM
Hi Steve,

Thanks for pointing me in right direction. I could get an http server up and running. But I couldn't figure out how I can extract parameters out of my http_request object, for both GET and POST requests... ?

The only way I see that this can be done is by string parsing of the entire message, which is quite costly. Please guide me again..

May 4, 2015 at 4:13 PM
Hi RaKi,

On the http_request object you can access the request URI via the http_request::request_uri method. This returns an web::uri object. From which you can access the query component of the URI and use a method like uri::split_query to break down all the parameters.