Process an HTTP response
- Last Updated: February 4, 2026
- 2 minute read
- OpenEdge
- Version 12.2
- Documentation
The response returned by the server to the HTTP client is copied to the HTTP response object. The response object contains the following fields:
INTEGER StatusCode—the HTTP response status codeCHARACTER StatusReason—the HTTP response status reasonCHARACTER ContentType—the response message content type (for example,text/xml,application/json)INTEGER ContentLength—the length (in bytes/characters) of the response messageCHARACTER CharacterEncoding—the response message's content type encoding (for example,charset='utf-8')RAW ContentMD5—an MD5 hash of the response message contentProgress.Lang.Object Entity—an ABL object containing the response message contentCHARACTER TransferEncoding—the transfer encoding used in the response messageCHARACTER Version—the HTTP version
The following example demonstrates how to process a response. In this
example, the response message is written to a log file if the status code that is
returned is 200. The response message content is extracted from the Entity property of the HTTP response object.
|
Response message content types
The following table lists the object types that the response message'sEntity field may contain, with the
corresponding MIME and ABL object types:| Content type | MIME type(s) | ABL object type |
|---|---|---|
TEXT |
text/* |
OpenEdge.Core.String |
JSON |
application/json |
|
XML |
text/xml,
text/xml-external-parsed-entity, application/xml,
application/xml-external-parsed-entity,
application/xml-dtd |
Implementation of |
Binary (including
media and PDF files) |
application/octet-stream,
application/pdf, application/zip, application/gzip, audio/*, image/*,
video/* |
OpenEdge.Core.ByteBucket,
OpenEdge.Core.Memptr |
Multipart |
multipart/* |
OpenEdge.Net.MultipartEntity |
Examples of how to process different content types are provided in the following topics:
- String response
- JSON response
- XML response
- Binary response
- Multipart response
- Response messages with error codes such as 404 or 501 do not cause the ABL HTTP client to throw the errors. They are processed just like any other response.
-
If the HTTP client is unable to transform the response body to an object type that represents the Content-Type header (as listed in the previous table), the data is returned as bytes of type
OpenEdge.Core.Memptr. The content type is changed toapplication/octet-stream. The original content type header returned by the server is set toX-Orig-Content-Type. You should, therefore, check the response's ContentType header as well as the ABL object type of the response'sEntityproperty, when deciding how to handle the response.