{title:'org.apache.juneau.http.entity', created:'9.0.0'}

The {@link oaj.http.entity} package contains implementations of org.apache.http.HttpEntity.

HttpEntityBuilder

HTTP entities are created through builders created in the {@link oaj.http.HttpEnties} class or individual create() methods defined in the subclasses above. The builder contains the following methods:

Example

| import static org.apache.juneau.http.HttpEntities.*; | | byte[] payload = {...}; | | // Create via type builder. | HttpEntity entity = ByteArrayEntity | .create() | .content(payload) | .contentType(ContentType.APPLICATION_OCTET_STREAM) | .build(); | | // Create via HttpEntities. | HttpEntity entity = byteArrayEntity(payload, ContentType.APPLICATION_OCTET_STREAM).build();