AutoIt
AutoIt
Transition from Http.PText to Http.HttpStr
Provides instructions for replacing deprecated PText method calls with HttpStr.Chilkat AutoIt Downloads
Local $bSuccess = False
$oHttp = ObjCreate("Chilkat.Http")
Local $sVerb = "PUT"
Local $sUrl = "https://example.com/"
Local $sTextData = "This is the HTTP request body"
Local $sCharset = "utf-8"
Local $sContentType = "text/plain"
; ------------------------------------------------------------------------
; The PText method is deprecated:
Local $oResponseObj = $oHttp.PText($sVerb,$sUrl,$sTextData,$sCharset,$sContentType,False,False)
If ($oHttp.LastMethodSuccess = False) Then
ConsoleWrite($oHttp.LastErrorText & @CRLF)
Exit
EndIf
; ...
; ...
; ------------------------------------------------------------------------
; Do the equivalent using HttpStr.
; Your application creates a new, empty HttpResponse object which is passed
; in the last argument and filled upon success.
$oResponseOut = ObjCreate("Chilkat.HttpResponse")
$bSuccess = $oHttp.HttpStr($sVerb,$sUrl,$sTextData,$sCharset,$sContentType,$oResponseOut)
If ($bSuccess = False) Then
ConsoleWrite($oHttp.LastErrorText & @CRLF)
Exit
EndIf