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

The {@link oaj.http.response} package contains predefined org.apache.http.HttpResponse implementations for most standard HTTP responses.

These are built upon existing HttpComponents APIs:

The most common location where these responses are used are in REST operation methods described later.

Example:

| @RestDelete(path="/{id}") | public Ok doDelete(@Path int id) throws NotFound, Unauthorized { | pojoService.delete(pojoService.find(id).orElseThrow(NotFound::new)); | return Ok.OK; | }

The following classes are also provided for constructing your own custom responses:

HttpResponseBuilder / HttpExceptionBuilder

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