Child pages
  • Response

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Divcache
Div
iddescription
HTML Table
id
classservoy sSummary
Colgroup Tag
Col
width80px
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summary
Table Row (tr)
Table Cell (td)
String
Table Cell (td)getCharset()
styleindexdisplay:none

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.

true
refresh100d
showRefreshtrue
iddoc
titleRefresh page
showDatetrue
retryEnable
id

servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClient

Table Cell (td)
byte[]
Table Cell (td)getMediaData()
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 Row (tr) Table Cell (td)getResponseBody()
Getter for the exception message.Get the content of response as binary data. Table Row (tr)
Table Cell (td)
String
Table Cell (td)
Object
Table Cell (td)getResponseHeaders()
Get the content of the response as String. Table Row (tr) Table Cell (td)getResponseHeaders(headerName)
Gets the headers of the response as name/value arrays. Table Row (tr)
Table Cell (td)
Object
Gets the headers of the response as name/value arrays. Table Row (tr)
Table Cell (td)
Number
Table Cell (td)getStatusCode()
Gets the status code of the response, the list of the possible values is in HTTP_STATUS constants.Gets the status code's reason phrase.

HTML Table

functionclass Colgroup Tag Colcolspanservoy sDetail2width100%

Col
Table Head (thead) Table Row (tr)styleheight:30px;
Table Head (th)
colspan2
Method Details
Table Body (tbody)
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();
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetMediaData
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();
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
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();
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
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]);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
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");
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
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
Table Row (tr)
classlastDetailRow
Table Cell (td) 2Methods 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
lastDetailRow
getCharsetname

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