public final class HttpRestProvider extends Object implements HttpProvider
| Constructor and Description |
|---|
HttpRestProvider(URL url) |
| Modifier and Type | Method and Description |
|---|---|
HeaderAndBody |
delete(String id)
Issues an HTTP request, consumes the content, and cleans up
after itself.
|
HeaderAndBody |
get()
Issues an HTTP request, consumes the content, and cleans up
after itself.
|
URL |
getUrl() |
HeaderAndBody |
post(String data)
Issues an HTTP request, consumes the content, and cleans up
after itself.
|
HeaderAndBody |
put(String id,
String data)
Issues an HTTP request, consumes the content, and cleans up
after itself.
|
void |
setDefaultHeader(String headerName,
String headerValue)
Will set a default header value to be used on all calls
|
public HttpRestProvider(URL url)
public URL getUrl()
getUrl in interface HttpProviderpublic HeaderAndBody get() throws HttpException
get in interface HttpProviderHttpException - if the http request doesn't return status 200public HeaderAndBody post(String data) throws RuntimeException
post in interface HttpProviderHttpException - if the http request doesn't return status 200RuntimeExceptionpublic HeaderAndBody put(String id, String data) throws RuntimeException
put in interface HttpProviderHttpException - if the http request doesn't return status 200RuntimeExceptionpublic HeaderAndBody delete(String id) throws RuntimeException
delete in interface HttpProviderHttpException - if the http request doesn't return status 200RuntimeExceptionpublic void setDefaultHeader(String headerName, String headerValue)
HttpProvidersetDefaultHeader in interface HttpProviderheaderName - nameheaderValue - valueCopyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.