OpenEdge.Net.HTTP.IHttpResponse
- Last Updated: October 17, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
Once a request successfully executes (note that success is defined as a successful round trip,
however a successful request may return undesired or unexpected results), an
IHttpResponse object is returned to the caller. The two most
important pieces of data this object returns are the StatusCode and
the Entity properties.
The Entity property has a defined type of
Progress.Lang.Object although the type of the object contained
in it is usually something more specialized. The response will convert text received
by an HTTP client into a JsonConstruct,
OpenEdge.Core.String or some other type, depending on the
ContentType of the response.
The StatusCode property indicates the result
of the request. These values can be enumerated by OpenEdge.Net.HTTP.StatusCodeEnum, which is based on https://www.rfc-editor.org/rfc/rfc9110.html#name-status-codes.
Examples
Entity
and writes it to disk in the correct format based on the type of the returned
Entity. We can also use the response's ContentType property to perform similar
operations.Credentials and
create the temp folder where the output is
written.Extracting typed data from a response
|
The code sample below retrieves the StatusCode of a request and
displays it as a message in an alert box.
Status codes
|