2022.2

Table Of Contents
Supported methods
create() CreatesanewinstanceofScriptableHTTPRequest.
l
open(Stringmethod,Stringurl,Stringuser,Stringpassword)
l
open(Stringverb,Stringurl,StringuserName,Stringpassword,String
[]headers,String[]headervalues,StringrequestBody)
OpensaHTTPrequest.
Ifyoudon'tuseausernameandpassword,passempty
strings:request.open("GET",url,"","");
l
send()
l
send(StringrequestBody)
SendsanHTTPrequestandreturnstheHTTPstatuscode.
Blockedcall.
getResponseHeader(Stringheader) GetstheResponseHeaderbyname.
getResponseHeaders() ReturnsthefullresponseheadersofthelastHTTPrequest.
getRequestBody() GetstheHTTPrequestbody(forPOSTandPUT).
setRequestHeader(StringrequestHeader,Stringvalue) AddsanadditionalHTTPrequestheader.
getResponseBody() ReturnsthefullresponsebodyofthelastHTTPrequest.
setRequestBody(StringrequestBody) SetstheHTTPrequestbody(forPOSTandPUT).
getPassword() GetsthepasswordforHTPPbasicauthentication
setPassword(Stringpassword) SetsthepasswordforHTPPbasicauthentication
getTimeout() Getsthetimetowaitfortheserver'sresponse
setTimeout(inttimeout) Setsthetime(inms.)towaitfortheserver'sresponse.
getUsername() getstheusernameforbasicHTTPauthentication.
setUsername(StringuserName) setstheusernameforbasicHTTPauthentication
abort() Abortstherequest.
createTmpFile()
Functionthatcreatesafilewithauniquenameinthetemporaryworkfolderandreturnsafileobject.
Thisfilestoresdatatemporarilyinmemoryorinabuffer.Itisusedtopreventmultipleinput/output
accesstoaphysicalfilewhenwriting.Intheend,thecontentsaretransferredtoaphysicalfileforwhich
onlyasingleinput/outputaccesswilloccur.
Inthefollowingscript,thecontentsofthedatasamplefilearecopiedinuppercasetoatemporaryfile.
Page 406