The {@link oaj.http.entity} package contains implementations of org.apache.http.HttpEntity.
- {@code org.apache.http.HttpEntity}
- {@link oaj.http.entity.BasicHttpEntity}
- {@link oaj.http.entity.ByteArrayEntity}
- {@link oaj.http.entity.FileEntity}
- {@link oaj.http.entity.InputStreamEntity}
- {@link oaj.http.entity.ReaderEntity}
- {@link oaj.http.entity.SerializedEntity}
- {@link oaj.http.entity.StringEntity}
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:
- {@link oaj.http.entity.HttpEntityBuilder}
- {@link oaj.http.entity.HttpEntityBuilder#cached() cached()}
- {@link oaj.http.entity.HttpEntityBuilder#chunked() chunked()}
- {@link oaj.http.entity.HttpEntityBuilder#chunked(boolean) chunked(boolean)}
- {@link oaj.http.entity.HttpEntityBuilder#content(Object) content(Object)}
- {@link oaj.http.entity.HttpEntityBuilder#content(Supplier) content(Supplier)}
- {@link oaj.http.entity.HttpEntityBuilder#contentEncoding(ContentEncoding) contentEncoding(ContentEncoding)}
- {@link oaj.http.entity.HttpEntityBuilder#contentEncoding(String) contentEncoding(String)}
- {@link oaj.http.entity.HttpEntityBuilder#contentLength(long) contentLength(long)}
- {@link oaj.http.entity.HttpEntityBuilder#contentType(ContentType) contentType(ContentType)}
- {@link oaj.http.entity.HttpEntityBuilder#contentType(String) contentType(String)}
| 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();