public interface HttpTransport extends Closeable
| Modifier and Type | Method and Description |
|---|---|
SimpleHttpResponse |
delete(URI uri)
Performs an HTTP DELETE.
|
SimpleHttpResponse |
get(URI uri)
Performs an HTTP GET.
|
SimpleHttpResponse |
patch(URI uri,
byte[] content)
Performs an HTTP PATCH.
|
SimpleHttpResponse |
post(URI uri,
InputStream content,
long length,
String contentType,
String acceptContentType)
Performs an HTTP POST of an API entity.
|
SimpleHttpResponse |
postParams(URI uri,
com.google.common.collect.Multimap<String,String> params)
Performs an HTTP POST with form parameters.
|
SimpleHttpResponse |
put(URI uri,
byte[] content)
Performs an HTTP PUT of an API entity.
|
HttpTransport |
withRequestDecorator(RequestDecorator decorator)
Returns another
HttpTransport instance that behaves the same as this one except that
it adds headers from the specified RequestDecorator to every request (in
addition to any headers previously specified in the defaults). |
SimpleHttpResponse get(URI uri) throws MpacException
uri - URI of resource to getSimpleHttpResponse wrapping the HTTP responseMpacException - if the server was unavailable or returned no responseSimpleHttpResponse postParams(URI uri, com.google.common.collect.Multimap<String,String> params) throws MpacException
uri - URI of resource to post toparams - the unencoded parametersSimpleHttpResponse wrapping the HTTP responseMpacException - if the server was unavailable or returned no responseSimpleHttpResponse post(URI uri, InputStream content, long length, String contentType, String acceptContentType) throws MpacException
uri - URI of resource to post tocontent - input stream containing the request bodylength - length of the input streamcontentType - content type of the entityacceptContentType - expected content type of responseSimpleHttpResponse wrapping the HTTP responseMpacException - if the server was unavailable or returned no responseSimpleHttpResponse put(URI uri, byte[] content) throws MpacException
uri - URI of resource to putcontent - request bodySimpleHttpResponse wrapping the HTTP responseMpacException - if the server was unavailable or returned no responseSimpleHttpResponse patch(URI uri, byte[] content) throws MpacException
uri - URI of resource to putcontent - request bodySimpleHttpResponse wrapping the HTTP responseMpacException - if the server was unavailable or returned no responseSimpleHttpResponse delete(URI uri) throws MpacException
uri - URI of resource to deleteSimpleHttpResponse wrapping the HTTP responseMpacException - if the server was unavailable or returned no responseHttpTransport withRequestDecorator(RequestDecorator decorator)
HttpTransport instance that behaves the same as this one except that
it adds headers from the specified RequestDecorator to every request (in
addition to any headers previously specified in the defaults). The new instance still
uses the same underlying HTTP transport; closing one will close the other.decorator - will generate additional headers for requests made via the new instanceHttpTransport instanceCopyright © 2016 Atlassian. All rights reserved.