I am working on a application where-in i have to hit a URL and get the HTTP status code returned from that URL. Currently I am using WININET functions to achieve this. The code to achieve this:
hOpen = InternetOpenA("MYAPP", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); hFile = InternetOpenUrlA(hOpen, url.c_str() , NULL, 0,INTERNET_FLAG_RELOAD, 0); HttpQueryInfoA(hFile,HTTP_QUERY_STATUS_CODE,(void*)buffer,&dwBufLen,NULL);
I did some checks to see the performance and i can see that on average a hit is taking about 300 milli-seconds. As i will be making multiple hits, the total time comes to about 8-10 sec which is slowing down the whole application.
Also the same is achieved on MAC is about 100 milli-seconds or so(i am using COCOA).
So are there any other APIs on WIN which i can use to get this faster?
Thanks in advance, Amit