I was going through the MSDN page comparing WinInet and WinHttp. Seems as though WinInet has more functionality than WinHttp. The MSDN page is here. Under what circumstances would one choose WinHttp over WinInet?
Considering that WinInet has HttpSendRequest that can be used to POST data and WinHttp also has WinHttpSendRequest. What would be the advantages of taking WinHttp over WinInet? Is there a difference in how the data is posted using WinHttp and WinInet?
In addition, if some examples of POSTing requests with both WinHttp and WinInet would help, some small sample codes.
EDIT 3 WIRESHARK SCREENSHOT

EDIT 2 I finally managed to get a HTTP_STATUS_CODE from the app and it's 200 OK but the problem comes when sending the post data, it is sent but the parameters aren't set. I tried implementing this code on the PHP end.
<?php
$fp = fopen("data.txt", "a");
fwrite($fp, "ID = " . $_POST['id']);
fclose($fp);
?>
the file is created as soon as the app runs but the ID parameter is not set, it writes to the file "ID = " and no more. the 10 is not being passed through, no idea why
Thank You.
EDIT: Link to the example I tried to use. HttpSendRequest to POST form data
Actually MSDN has a good page on WinHTTP vs. WinINet, stating:
With a few exceptions, WinINet is a superset of WinHTTP. When selecting between the two, you should use WinINet, unless you plan to run within a service or service-like process that requires impersonation and session isolation.
This example should help you out and if you are interested in WinInet example you can look in here.
Further more, a quote regarding WinInet from MSDN:
Note WinINet does not support server implementations. In addition, it should not be used from a service. For server implementations or services use Microsoft Windows HTTP Services (WinHTTP).
Which is a good advice.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With