WinHTTP functions UDF


SUBMITTED BY: Guest

DATE: May 28, 2013, 5:30 p.m.

FORMAT: Text only

SIZE: 702 Bytes

HITS: 964

  1. #include "WinHttp.au3"
  2. Opt("MustDeclareVars", 1)
  3. ; Open needed handles
  4. Local $hOpen = _WinHttpOpen()
  5. Local $hConnect = _WinHttpConnect($hOpen, "msdn.microsoft.com")
  6. ; Specify the reguest:
  7. Local $hRequest = _WinHttpOpenRequest($hConnect, Default, "en-us/library/aa384101(VS.85).aspx")
  8. ; Send request
  9. _WinHttpSendRequest($hRequest)
  10. ; Wait for the response
  11. _WinHttpReceiveResponse($hRequest)
  12. Local $sHeader = _WinHttpQueryHeaders($hRequest) ; ...get full header
  13. ; Clean
  14. _WinHttpCloseHandle($hRequest)
  15. _WinHttpCloseHandle($hConnect)
  16. _WinHttpCloseHandle($hOpen)
  17. ; Display retrieved header
  18. MsgBox(0, "Header", $sHeader)

comments powered by Disqus