HttpRequest and HttpResponse System Entities
Introduction
HttpRequest is a system entity that represents a request to a server. HttpResponse represents the response from the server. Use these entities when publishing or consuming REST services.
HttpRequest
The HttpRequest entity has the following attributes:
| Attribute | Type | Default Value | Description |
|---|---|---|---|
HttpVersion (Inherited from HttpMessage) |
String | HTTP/1.1 | The protocol version. You can almost always ignore this value. |
Uri |
String | empty | The full URI for the incoming request, including query parameters. |
Content (inherited from HttpMessage) |
String | empty | The body of the request. |
You can retrieve the request headers via the HttpHeaders association.
HttpResponse
The HttpResponse entity has the following attributes:
| Attribute | Type | Default Value | Description |
|---|---|---|---|
HttpVersion (inherited from HttpMessage) |
String | HTTP/1.1 | The protocol version. You can almost always ignore this value. |
StatusCode |
Integer | 200 | The HTTP status code returned by the server. |
ReasonPhrase |
String | OK | A textual representation of the StatusCode. |
Content |
String | empty | The body of the response. |
For more information on HTTP status codes, see the W3C Specification of Status Code Definitions.
ReasonPhrase as it will be replaced by a standard reason phrase by the web server. For example, for StatusCode 200, any custom ReasonPhrase you set will be replaced by OK.
You can retrieve or create response headers via the HttpHeaders association.
An important HttpResponse header is Content-Type, which indicates how the content should be interpreted. For more information on this header, see the W3C specification of Content-Type.