Child pages
  • Response

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table Cell (td)
String

...

DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING.
THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO AUTO UPDATE THE CONTENT THROUGH THE DOC GENERATOR.
Enter additional information related to this 'class' inside the {div} macro with 'id=description'
Divcache
styleindexdisplay:none

...

iddescription

...

padding0px
width80px

...

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summary
true
refresh100d
showRefreshtrue
iddoc
titleRefresh page
showDatetrue
retryEnable

servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClient

servoy sSummary12%30%58%height: 30px;3Methods SummaryNeeds to be called when not reading content via getResponseBody or getMediaData to be able to reuse the client.Get the charset of the response body

...

Table Cell (td)
byte[]

...

Table Cell (td)
String

...

.Getter for the exception message.Get the content of response as binary data.

...

...

Get the content of the response as String.

...

Table Cell (td)
Object

...

Gets the headers of the response as name/value arrays.

...

Table Cell (td)
Object
Gets the headers of the response as name/value arrays.

...

Table Cell (td)
Number

...

Table Row (tr)
idname
Table Cell (td)
getMediaData
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
byte[]
Span
stylefont-weight: bold;
getMediaData
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get the content of response as binary data. It also supports gzip-ed content.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
byte[]
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var mediaData = response.getMediaData();

...

classlastDetailRow

...

idgetResponseBody
Table Row (tr)
idname
Table Cell (td)
getResponseBody
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getResponseBody
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get the content of the response as String.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var pageData = response.getResponseBody();

...

classlastDetailRow

...

idgetResponseHeaders
Table Row (tr)
idname
Table Cell (td)
getResponseHeaders
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Object
Span
stylefont-weight: bold;
getResponseHeaders
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Gets the headers of the response as name/value arrays.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Object
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var allHeaders = response.getResponseHeaders();
var header;

for (header in allHeaders) application.output(header + ': ' + allHeaders[header]);

...

classlastDetailRow

...

idgetResponseHeaders-String
Table Row (tr)
idname
Table Cell (td)
getResponseHeaders
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Object
Span
stylefont-weight: bold;
getResponseHeaders
Span
(headerName)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Gets the headers of the response as name/value arrays.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{String} headerName
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Object
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var contentLength = response.getResponseHeaders("Content-Length");

...

classlastDetailRow

...

idgetStatusCode
Table Row (tr)
idname
Table Cell (td)
getStatusCode
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
getStatusCode
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Gets the status code of the response, the list of the possible values is in HTTP_STATUS constants.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var status = response.getStatusCode();// compare with HTTP_STATUS constants

...

classlastDetailRow

...

Gets the status code of the response, the list of the possible values is in HTTP_STATUS constants.

...

idfunction
classservoy sDetail

...

padding0px
width100%
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Method Details

...

idgetCharset
Table Row (tr)
idname
Table Cell (td)
getCharset
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getCharset
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get the charset of the response body.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var charset = response.getCharset();

...

classlastDetailRow

...

idgetMediaData
Gets the status code's reason phrase.

functionservoy sDetail2100%height:30px2Methods Detailsclosename

close()

dessIndent
Needs to be called when not reading content via getResponseBody or getMediaData
to be able to reuse the client.
ret

Returns

sIndent true if the entity content is consumed and content stream (if exists) is closed
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRowgetCharsetname

getCharset()

dessIndent
Get the charset of the response body.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getExceptionname

getException()

dessIndent
Getter for the exception message.
ret

Returns

sIndent the exception message
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getMediaDataname

getMediaData()

dessIndent
Get the content of response as binary data. It also supports gzip-ed content.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getResponseBodyname

getResponseBody()

dessIndent
Get the content of the response as String.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getResponseHeadersname

getResponseHeaders()

dessIndent
Gets the headers of the response as name/value arrays.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getResponseHeadersname

getResponseHeaders(headerName)

dessIndent
Gets the headers of the response as name/value arrays.
prs

Parameters

sIndentheaderName ;
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getStatusCodename

getStatusCode()

dessIndent
Gets the status code of the response, the list of the possible values is in HTTP_STATUS constants.

In case there was an exception executing the request, please ignore/do not use this value (it will be 0).
You can check that situation using response.getException().
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getStatusReasonPhrasename

getStatusReasonPhrase()

dessIndent
Gets the status code's reason phrase. For example if a response contains status code 403 (Forbidden) it might be useful to know why.

For example a Jenkins API req. could answer with "403 No valid crumb was included in the request" which will let you know
that you simply have to reques a crumb and then put that in the request headers as "Jenkins-Crumb". But you could not know that from 403 status alone...
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow