Skip to main content
Version: v6.5.0

Send HTTP request

Command Description

HTTP.Request sends an HTTP request

Command Prototype

sRet = HTTP.Request(method, url, body_type, body, headers, cookies, cert, timeout)

Command parameter

parametermandatorytypedefault valueInstructions
methodTruestring""HTTP Request Method
urlTruestring""Request URL
body_typeFalsestring""Request body type
bodyFalseexpression{}Request body data
headersFalseexpression{}Request Header
cookiesFalseexpression{}Request cookie
certFalseexpression{}If the client certificate, dictionary type, CERT-PATH, and key are all empty, the authentication will be ignored. If there is no key, the key can be left blank
timeoutFalsenumbersixty thousandTimeout (milliseconds)

Return result

SRet, Assign the result of running the command to this variable.

Run instance

/**************************Send HTTP Request**************************
Command prototype:
sRet = HTTP.Request(method, url, body_type, body, headers, cookies, cert, timeout)
Input parameters:
method -- HTTP request method. Note: GET, POST, PUT, DELETE, HEAD, OPTIONS, TRACE, CONNECT.
url -- Request URL. Note: Request URL.
body_type -- Request body type. Note: Optional values are: json, form, form-data, text, html, xml, binary.
body -- Request body data.
headers -- Request headers.
cookies -- Request cookies.
cert -- Client certificate.
timeout -- Timeout (in milliseconds).
Output parameters:
sRet -- The variable where the output of the function call is saved.
Notes:
None
******************************************************************/

Dim sRet = ""
sRet = HTTP.Request("GET", "https://www.baidu.com", "", "", {}, {}, "", 60000)
TracePrint(sRet)