supplied.
• transformation
Unusually the invokeHttp() method seems to execute synchronously. The result is a
JavaScript object that contains the response from the HTTP request.
The properties in the response are:
• info
• errors
• warnings
• isSuccessful – true or false
• responseHeaders – The HTTP headers received in the response from the HTTP
request.
• responseTime – The HTTP response time in milliseconds,
• totalTime – The total time in milliseconds.
• result – A JavaScript object representing the result returned from the HTTP request. If
the result returned from the HTTP request is not JSON encoded, it has to be first
transformed into a JavaScript object.
• statusCode – The HTTP status code. 200 means ok.
• statusReason
◦ OK
•
The following is an example of a JavaScript object returned by invokeHttp.
{
"errors": [
],
"info": [
],
"isSuccessful": true,
"responseHeaders": {
"Cache-Control": "max-age=0, public",
"Connection": "Keep-Alive",
"Content-Type": "text\/xml",
"Date": "Wed, 30 Oct 2013 18:02:04 GMT",
"Expires": "Wed, 30 Oct 2013 18:02:04 GMT",
"Keep-Alive": "timeout=10, max=30",
"Server": "Apache",
"Transfer-Encoding": "chunked",
"Vary": "Accept-Encoding,User-Agent"
},
"responseTime": 335,
"result": {
"rep": [
{
"district": "Senior Seat",
"link": "http:\/\/www.cornyn.senate.gov",
"name": "John Cornyn",
"office": "517 Hart Senate Office Building",
"party": "R",
"phone": "202-224-2934",
"state": "TX"
},
{
"district": "Junior Seat",
"link": "http:\/\/www.cruz.senate.gov",
Page 118
Comentários a estes Manuais