Take the 2-minute tour ×

A rather simple question. Should I use the WinHttp library to make a web service request in my C++ programs or should I use the IXmlHttpRequest interface in the msxml library to send web service requests? Obviously the WinHttp library provides a lot more fine control compared to the IXmlHttpRequest library. But the XmlHttpRequest object is a w3.org standard and in theory more portable.

share|improve this question
add comment

3 Answers

up vote 0 down vote accepted

It depends whether you are accessing the service on secure channel i.e. HTTPS or simple one i.e. HTTP.

As per MSDN (http://msdn.microsoft.com/en-us/library/ms891732.aspx), IXMLHttpRequest supports only HTTP.

Note IXMLHTTPRequest does not support secure website access. To access a secure website, use the WinINet API.

But WinInet API is quite old and have some multi-threading issues (I think its there on MSDN too)...

So the best bet is WinHTTP for HTTPS and HTTP, otherwise good old IXMLHttpRequest.

Note: libcurl and curlpp (c++ port of libcurl) is also there to check. There is an old post for this http://stackoverflow.com/questions/1011339/how-do-you-make-a-http-request-with-c

share|improve this answer
add comment

Simple answer to your "simple question": You should use what you feel most comfortable in and what best fits to your requirements.

You could also consider the http client in boost::asio.

share|improve this answer
add comment

From my own personal experience I have used MSXML2.XMLHTTP60 to successfully log into a secure (HTTPS) website. The best thing to do is to try everything out for yourself, because even official docs can sometimes be incorrect or outdated.

share|improve this answer
add comment

Your Answer


