views:

394

answers:

2

I have recently been given a task to add the ability to interact with Web Map Services to an existing MFC application and I am in need of a client-side HTTP API.

Based on my research, the leading candidates seem to be CAtlHttpClient and WinHTTP. I was curious to see if anyone had experiences they could share or opinions on which would be the better way to go (or suggestions for something else entirely).

At first glance, CAtlHttpClient seems to be a bit higher level and easier to use. However, in my research it seemed that any time people had a problem with not being able to do something with it, the answer was "use WinHTTP".

Result

I wound up using WinHTTP because WinInet displays dialog boxes and our application is usable through a COM API. I avoided Ultimate TCP/IP because I work for a large company and getting third party software approved for use in a product is a complete nightmare.

+1  A: 

Try Ultimate TCP/IP available for free from here:

http://www.codeproject.com/KB/MFC/UltimateTCPIP.aspx

It's a very good library and very easy to integrate with your apps.

Rob
+1 for the useful information, although I'm not sure if I'll use it or not :)
17 of 26
+1  A: 

The simplest one is the WinInet MFC wrappers: CInternetSession and friends.

WinHTTP, although a different API, is built on the same model as WinInet yet provides better HTTP support (no FTP though but you probably don't care). Whether you need the extra goodies provided by WinHTTP should be examined.

A down side of WinHTTP is that ATL/MFC don't provide wrappers for it, as opposed to WinInet.

And as Rob mentioned, UltimateTCP is a excellent alternative. One of its advantages is that it's a library: you link the code into your application, thereby eliminating DLL hell potential problems. Also, it comes with full source code which might be convenient if you run into a limitation of the implementation.

Make your pick!

Serge - appTranslator
+1 Those WinInet MFC wrappers look promising, and a lot easier to use than the WinHTTP stuff. Now I just need to figure out what WinHTTP has that WinInet does not so I can decide.
17 of 26
Ah, looks like WinInet is out for me - it displays dialog boxes for some things and our application can be run without a UI via a COM API.
17 of 26