GetNetworkRequestStatus
Returns a value indicating the status of the most recent HTTP request.
Note: This command is not supported for BREW devices.
|
Command |
Parameters |
Value Returned |
|---|---|---|
|
GetNetworkRequestStatus |
None |
-1: The command is not supported. |
The following example assigns the status of the most recent HTTP request to the requesttatus variable, and then uses a switch statement to update a text field with the status:
requeststatus = fscommand2("GetNetworkRequestStatus");
switch (requeststatus) {
case -1:
_root.myText += "requeststatus not supported" + "\n";
break;
case 0:
_root.myText += "connection to server has been made" + "\n";
break;
case 1:
_root.myText += "connection is being established" + "\n";
break;
case 2:
_root.myText += "pending request, contacting network" + "\n";
break;
case 3:
_root.myText += "pending request, resolving domain" + "\n";
break;
case 4:
_root.myText += "failed, network error" + "\n";
break;
case 5:
_root.myText += "failed, couldn't reach server" + "\n";
break;
case 6:
_root.myText += "HTTP error" + "\n";
break;
case 7:
_root.myText += "DNS failure" + "\n";
break;
case 8:
_root.myText += "request has been fulfilled" + "\n";
break;
case 9:
_root.myText += "request timedout" + "\n";
break;
case 10:
_root.myText += "no HTTP request has been made" + "\n";
break;
}