Codeunit "Http Response Message"
Holder object for the HTTP response data.
Properties
Name | Value |
---|---|
Access | Public |
InherentEntitlements | X |
InherentPermissions | X |
Methods
Create
Initializes a new instance of the HttpResponseMessage class.
procedure Create(HttpResponseMessage: HttpResponseMessage): Codeunit "Http Response Message"
Parameters
Name | Type | Description |
---|---|---|
HttpResponseMessage | HttpResponseMessage |
The HTTP response message. |
Returns
Type | Description |
---|---|
System.RestClient."Http Response Message" |
The HttpResponseMessage object. |
SetIsBlockedByEnvironment
Sets whether the request is blocked by the environment.
procedure SetIsBlockedByEnvironment(Value: Boolean)
Parameters
Name | Type | Description |
---|---|---|
Value | Boolean |
True if the request is blocked by the environment; otherwise, false. |
GetIsBlockedByEnvironment
Gets whether the request is blocked by the environment.
procedure GetIsBlockedByEnvironment(): Boolean
Returns
Type | Description |
---|---|
Boolean |
True if the request is blocked by the environment; otherwise, false. |
SetHttpStatusCode
procedure SetHttpStatusCode(Value: Integer)
Parameters
Name | Type | Description |
---|---|---|
Value | Integer |
GetHttpStatusCode
Gets the HTTP status code of the response message.
procedure GetHttpStatusCode(): Integer
Returns
Type | Description |
---|---|
Integer |
The HTTP status code. |
SetIsSuccessStatusCode
Sets whether the HTTP response message has a success status code.
procedure SetIsSuccessStatusCode(Value: Boolean)
Parameters
Name | Type | Description |
---|---|---|
Value | Boolean |
True if the HTTP response message has a success status code; otherwise, false. |
Remarks
Any value in the HTTP status code range 2xx is considered to be successful.
GetIsSuccessStatusCode
Indicates whether the HTTP response message has a success status code.
procedure GetIsSuccessStatusCode(): Boolean
Returns
Type | Description |
---|---|
Boolean |
True if the HTTP response message has a success status code; otherwise, false. |
Remarks
Any value in the HTTP status code range 2xx is considered to be successful.
SetReasonPhrase
Sets the reason phrase which typically is sent by servers together with the status code.
procedure SetReasonPhrase(Value: Text)
Parameters
Name | Type | Description |
---|---|---|
Value | Text |
The reason phrase sent by the server. |
GetReasonPhrase
Gets the reason phrase which typically is sent by servers together with the status code.
procedure GetReasonPhrase(): Text
Returns
Type | Description |
---|---|
Text |
The reason phrase sent by the server. |
SetContent
Sets the HTTP content sent back by the server.
procedure SetContent(Content: Codeunit "Http Content")
Parameters
Name | Type | Description |
---|---|---|
Content | System.RestClient."Http Content" |
The content of the HTTP response message. |
GetContent
Gets the HTTP content sent back by the server.
procedure GetContent(): Codeunit "Http Content"
Returns
Type | Description |
---|---|
System.RestClient."Http Content" |
The content of the HTTP response message. |
SetResponseMessage
Sets the HTTP response message.
procedure SetResponseMessage(ResponseMessage: HttpResponseMessage)
Parameters
Name | Type | Description |
---|---|---|
ResponseMessage | HttpResponseMessage |
The HTTP response message. |
GetResponseMessage
Gets the HTTP response message.
procedure GetResponseMessage(): HttpResponseMessage
Returns
Type | Description |
---|---|
HttpResponseMessage |
The HTTPResponseMessage object. |
SetHeaders
Sets the HTTP headers.
procedure SetHeaders(Headers: HttpHeaders)
Parameters
Name | Type | Description |
---|---|---|
Headers | HttpHeaders |
The HTTP headers. |
GetHeaders
Gets the HTTP headers.
procedure GetHeaders(): HttpHeaders
Returns
Type | Description |
---|---|
HttpHeaders |
The HTTP headers. |
SetCookies
Sets the cookies in the HTTP response message.
procedure SetCookies(Cookies: Dictionary of [Text, Cookie])
Parameters
Name | Type | Description |
---|---|---|
Cookies | Dictionary of [Text, Cookie] |
The cookies to set. |
GetCookies
Gets the cookies in the HTTP response message.
procedure GetCookies(): Dictionary of [Text, Cookie]
Returns
Type | Description |
---|---|
Dictionary of [Text, Cookie] |
The cookies in the HTTP response message. |
GetCookieNames
Gets the names of the cookies that are set in the HTTP response message.
procedure GetCookieNames(): List of [Text]
Returns
Type | Description |
---|---|
List of [Text] |
The names of the cookies that are set in the HTTP response message. |
GetCookie
Gets the cookie with the given name from the HTTP response message.
procedure GetCookie(Name: Text): Cookie
Parameters
Name | Type | Description |
---|---|---|
Name | Text |
The name of the cookie to get. |
Returns
Type | Description |
---|---|
Cookie |
The cookie object. |
Remarks
If the cookie is not found, an empty cookie object is returned.
GetCookie
Gets the cookie with the given name from the HTTP response message.
procedure GetCookie(Name: Text, var Cookie: Cookie): Boolean
Parameters
Name | Type | Description |
---|---|---|
Name | Text |
The name of the cookie to get. |
Cookie | Cookie |
The cookie object to get. |
Returns
Type | Description |
---|---|
Boolean |
True if the cookie was found, false otherwise. |
SetErrorMessage
Sets an error message when the request failed.
procedure SetErrorMessage(Value: Text)
Parameters
Name | Type | Description |
---|---|---|
Value | Text |
The error message. |
GetErrorMessage
Gets the error message when the request failed.
procedure GetErrorMessage(): Text
Returns
Type | Description |
---|---|
Text |
The error message. |
SetException
Sets the exception information when the request failed.
procedure SetException(Exception: ErrorInfo)
Parameters
Name | Type | Description |
---|---|---|
Exception | ErrorInfo |
The exception information. |
GetException
Gets the exception information when the request failed.
procedure GetException(): ErrorInfo
Returns
Type | Description |
---|---|
ErrorInfo |
The exception information. |