AutoIt
AutoIt
Transition from Http.PTextSb to Http.HttpSb
Provides instructions for replacing deprecated PTextSb method calls with HttpSb.Chilkat AutoIt Downloads
Local $bSuccess = False
$oHttp = ObjCreate("Chilkat.Http")
Local $sVerb = "PUT"
Local $sUrl = "https://example.com/"
$oSbRequestBody = ObjCreate("Chilkat.StringBuilder")
$oSbRequestBody.Append("This is the HTTP request body")
Local $sCharset = "utf-8"
Local $sContentType = "text/plain"
; ------------------------------------------------------------------------
; The PTextSb method is deprecated:
Local $oResponseObj = $oHttp.PTextSb($sVerb,$sUrl,$oSbRequestBody,$sCharset,$sContentType,False,False)
If ($oHttp.LastMethodSuccess = False) Then
ConsoleWrite($oHttp.LastErrorText & @CRLF)
Exit
EndIf
; ...
; ...
; ------------------------------------------------------------------------
; Do the equivalent using HttpSb.
; 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.HttpSb($sVerb,$sUrl,$oSbRequestBody,$sCharset,$sContentType,$oResponseOut)
If ($bSuccess = False) Then
ConsoleWrite($oHttp.LastErrorText & @CRLF)
Exit
EndIf