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
parameter | mandatory | type | default value | Instructions |
---|---|---|---|---|
method | True | string | "" | HTTP Request Method |
url | True | string | "" | Request URL |
body_type | False | string | "" | Request body type |
body | False | expression | {} | Request body data |
headers | False | expression | {} | Request Header |
cookies | False | expression | {} | Request cookie |
cert | False | expression | {} | 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 |
timeout | False | number | sixty thousand | Timeout (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)