Jump to content

Search the Community

Showing results for tags 'winhttp utf-8 unicode post php'.

  • 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. Hi everyone! I'm trying to send a string (Filename in Arabic) as a post parameter to PHP using the WinHttp UDF. The problem i'm facing is that, at the server end, the string shows up as "Question Marks" and not in Arabic. However, if i send this string using the Winhttp Objects, it shows up properly in Arabic. Is there any setting in the WinHttp UDF that i need to set before sending the post request, something that would send the post parameter as a UTF-8 string? The request being sent is over SSL, and im using the _WinHttpSimpleSendSSLRequest function. here's the code im using. #NoTrayIcon #include<Winhttp.au3> $domain = "someserver.com" $sPath = "/utf-echo.php" Global $ua = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240" $utfText = "مرحبا بالعالم.docx" $postData = "utf=" & $utfText ;Using Winhttp Object _httpRequestObj("https://" & $domain & $sPath ,'POST', $postData, $ua) ;Using Winhttp UDF $hOpen = _WinHttpOpen($ua) $hConnect = _WinHttpConnect($hOpen, $domain) $hRequest = _WinHttpSimpleSendSSLRequest($hConnect, "POST", $sPath, Default, $postData, Default) Func _httpRequestObj($url, $method, $postData, $ua) $oHTTP = ObjCreate('WinHTTP.WinHTTPRequest.5.1') $method = StringLower($method) Local $oHTTP = ObjCreate('WinHttp.WinHttpRequest.5.1') $oHTTP.Open($method, $url, False) $oHTTP.SetRequestHeader('User-Agent', $ua) $oHTTP.Option(4) = 13056 $oHTTP.Option(9) = 168 If $method = 'GET' Then $oHTTP.Send() Else $oHTTP.SetRequestHeader('Content-Type', 'application/x-www-form-urlencoded') $oHTTP.SetRequestHeader('Content-Length', StringLen($postData)) $oHTTP.Send($postData) EndIf $oHTTP.WaitForResponse Local $ret[2] $ret["0"] = $oHTTP.Status $ret["1"] = $oHTTP.Responsetext Return $ret EndFunc ;==>_ProxyhttpRequest Output at the server end: Hope this explains the situation! Any help would be appreciated! thanks!!
×
×
  • Create New...