Jump to content

Search the Community

Showing results for tags 'winhttp ingetsize'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. This is the first time I've come across InetGetSize returning 0, I have an example below (though sometimes it will report a size greater than 0.) Having done a bit of research on the Forum, it appears that it used to be a bug in InetGetSize, though I have a WinHttp version which returns exactly the same result as InetGetSize, so I doubt this is a bug with InetGetSize today. I'm wondering is this a flaw in the header that is sent from the server or the functions? I'm going with the server, but would like to know your thoughts too. AutoIt v3.3.8.1. #include <Array.au3> #include <Constants.au3> #include 'WinHttp.au3' ; From the examples section. By trancexx. Local $sURL = 'http://pgl.yoyo.org/as/serverlist.php?hostformat=hosts&showintro=1&mimetype=plaintext' MsgBox($MB_SYSTEMMODAL, '', InetGetSize($sURL)) MsgBox($MB_SYSTEMMODAL, '', _InetGetSize($sURL)) ; WinHttp version. By guinness - 2013. Func _InetGetSize($sURL) Local $iInetSize = 0 ; Crack the URL into parts. Local Enum $eDomain = 2, $ePage = 6, $eExtraInfo Local $aURL = _WinHttpCrackUrl($sURL) If @error Then Return SetError(1, 0, $iInetSize) EndIf ; Initialize and get a session handle Local $hOpen = _WinHttpOpen() ; Get a connection handle. Local $hConnect = _WinHttpConnect($hOpen, $aURL[$eDomain]) ; Make a request. Local $hRequest = _WinHttpOpenRequest($hConnect, Default, $aURL[$ePage] & $aURL[$eExtraInfo]) ; Send a request. Specify additional data to send too. _WinHttpSendRequest($hRequest, Default) ; Wait for the response. _WinHttpReceiveResponse($hRequest) ConsoleWrite('DEBUG:' & @CRLF) ConsoleWrite(_WinHttpQueryHeaders($hRequest) & @CRLF) ; Query the header for content length. $iInetSize = Int(_WinHttpQueryHeaders($hRequest, $WINHTTP_QUERY_CONTENT_LENGTH)) ; Close handles _WinHttpCloseHandle($hRequest) _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hOpen) Return $iInetSize EndFunc ;==>_InetGetSize
×
×
  • Create New...