Http.Response
Description
A class representing the Response to a Http Request.
Properties
data | Gets the data sent with the request. |
failCallback | Gets the fail callback treenode. |
host | Gets the host used in the request. |
labelProperties | Use your own named properties to get/set label values. |
method | Gets the request Http.Method used in the request. |
path | Gets the resource path used in the request. |
port | Gets the port the request was sent to. |
receivedBytes | Gets the amount of bytes of the response message received. |
statusCallback | Gets the status callback treenode. |
statusCode | Gets the request's Http status code. |
successCallback | Gets the success callback treenode. |
timeout | Gets the request timeout in ms used in the request. |
totalBytes | Gets the size of the response message in bytes. |
useSSL | Gets whether SSL was used in the request. |
value | Gets the response message ot the Http request. |
Methods
saveToFile | Saves the Http.Response value to a file. |
Details
Http.Response.failCallback
readonly treenode failCallback
Description
Gets the fail callback treenode.
Http.Response.labelProperties
readonly Variant labelProperties
Description
Use your own named properties to get/set label values.
custom labels on Http.Response objects are inherited from the Http.Request object.
Http.Request request = Http.Request("https://www.flexsim.com/");
request.statusCallback = Model.find("Tools/statusCallback");
request.myProcessor = Model.find("Processor1");
Http.Response response = request.sendAndWait();
print(response.myProcessor); // /Processor1
Http.Response.method
readonly int method
Description
Gets the request Http.Method used in the request.
Http.Response.receivedBytes
readonly int receivedBytes
Description
Gets the amount of bytes of the response message received.
Http.Response.statusCallback
readonly treenode statusCallback
Description
Gets the status callback treenode.
Http.Response.statusCode
readonly int statusCode
Description
Gets the request's Http status code.
Http.Request request = Http.Request("https://www.flexsim.com/");
request.statusCallback = Model.find("Tools/statusCallback");
request.myProcessor = Model.find("Processor1");
request.sendAndWait();
//In the statusCallback node//
Http.Response response = param(1);
print(response.statusCode); // last print should be a 200
Http.Response.successCallback
readonly treenode successCallback
Description
Gets the success callback treenode.
Http.Response.timeout
readonly int timeout
Description
Gets the request timeout in ms used in the request.
Http.Response.totalBytes
readonly int totalBytes
Description
Gets the size of the response message in bytes.
Http.Response.value
readonly string value
Description
Gets the response message ot the Http request.
Http.Request request = Http.Request("https://www.flexsim.com/");
request.statusCallback = Model.find("Tools/statusCallback");
request.myProcessor = Model.find("Processor1");
Http.Response response = request.sendAndWait();
print(response.value); //prints the response message
Http.Response.saveToFile()
void saveToFile( string filePath ) |
Description
Saves the Http.Response value to a file.
Http.Request request;
request.host = "www.flexsim.com";
request.port = 443;
request.useSSL = 1;
request.successCallback = Model.find("Tools/successCallback");
Http.Response response = request.sendAndWait();
response.saveToFile(modeldir() + "flexsim_homepage.html");