Making connection to Web server

Aug 18, 2014 at 11:33 AM
Hi,

Thanks again for your outstanding support.

I have spent a lot of time to figure out how I can make a connection to our web server using username and password. I only want to open a connection and then fetch some stuff from a database (in Mongodb) using Casablanca and then close the connection when I am done.
(I can check whether the connection is open or not before any job). In your tutorial you have only one line for making a connection:
http_client client(L"http://www.fourthcoffee.com");
and then,
http_request request(methods::GET);
But I don’t want to make any request. I just want to open an authorized connection using username and password and then in other function make the request, fetch the data in Json format and parse it.
How can I do that? Could you please give me an example to put me on the right path?

Best regards
RezRaz
Coordinator
Aug 22, 2014 at 9:58 PM
Hi RezRaz,

I do not understand clearly "open an authorized connection using username and password". If the username and password are used for http authentication, then there is no way to create connections without sending any requests, because the user credentials are included in the request header.

Thanks