Sample code for 30+ languages & platforms
AutoIt Requires Chilkat v11.0.0+

HTTP POST with Binary Data in Request Body

See more HTTP Examples

Do an HTTPS POST with a binary request body.

Chilkat AutoIt Downloads

AutoIt
Local $bSuccess = False

;  This example assumes the Chilkat API to have been previously unlocked.
;  See Global Unlock Sample for sample code.

$oHttp = ObjCreate("Chilkat.Http")

$oFac = ObjCreate("Chilkat.FileAccess")

Local $oReqBody
$oReqBody = $oFac.ReadEntireFile("qa_data/pdf/helloWorld.pdf")

$oResp = ObjCreate("Chilkat.HttpResponse")
$bSuccess = $oHttp.HttpBinary("POST","https://example.com/something",$oReqBody,"application/pdf",$oResp)
If ($bSuccess = False) Then
    ConsoleWrite($oHttp.LastErrorText & @CRLF)
    Exit
EndIf

Local $iResponseStatusCode = $oResp.StatusCode
ConsoleWrite("Status code: " & $iResponseStatusCode & @CRLF)

;  For example, if the response is XML, JSON, HTML, etc.
ConsoleWrite("response body:" & @CRLF)
ConsoleWrite($oResp.BodyStr & @CRLF)