POST-Request--JSON
Command Description
Submit a JSON form by HTTP.Post
Command Prototype
sRet = HTTP.PostJson(sURL, sJSON, iTimeout)
Parameter Description
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
sURL | True | string | "" | URL of the Post page |
sJSON | True | expression | {} | JSON data sent during POST can be a string or a dictionary |
iTimeout | True | number | 60000 | Timeout (ms) |
return
sRet,The variable used to save the output of the command.
Demo
TracePrint("--------------------------Post submit JSON form-------- ----------")
//-------------------------------------------------------------------------------
//[Remarks] HTTP.Post submits a JSON form to the web page (if you need to use this command, please replace the URL and json string)
//Input parameter 1:
// sURL--The destination URL for submitting the json form. Note: the link address of the Get page
// sJSON--Uploaded json string. Note: Where is the data returned by Get saved?
// optionArgs--Optional parameters. Note: This parameter is a number of optional parameters, including error continue execution, delay after execution, delay before execution, activation window, cursor position, abscissa offset, ordinate offset, auxiliary keys, operation type
//out parameters:
// sRet--return the result after uploading Json
//Command prototype: sRet = HTTP.PostJson(sURL, sJSON, iTimeout)
sRet = HTTP.PostJson ("https://passport.baidu.com/v2/api/?login", {"mobile": "456"}, 60000)
TracePrint (sRet)