Package org.duracloud.common.web
Class RestHttpHelper
java.lang.Object
org.duracloud.common.web.RestHttpHelper
Provides helper methods for REST tests
- Author:
- Bill Branan
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRestHttpHelper(int socketTimeoutMs) ConstructorRestHttpHelper(Credential credential) RestHttpHelper(Credential credential, int socketTimeoutMs) -
Method Summary
Modifier and TypeMethodDescriptionmultipartFilePost(String url, File file) multipartFileStreamPost(String url, String fileName, InputStream stream) multipartPost(String url, org.apache.http.HttpEntity reqEntity) post(String url, InputStream requestContent, String mimeType, long contentLength, Map<String, String> headers) put(String url, InputStream requestContent, String mimeType, long contentLength, Map<String, String> headers)
-
Field Details
-
log
protected final org.slf4j.Logger log
-
-
Constructor Details
-
RestHttpHelper
public RestHttpHelper() -
RestHttpHelper
public RestHttpHelper(int socketTimeoutMs) Constructor- Parameters:
socketTimeoutMs- A socket timeout of less than zero indicates "no timeout".
-
RestHttpHelper
-
RestHttpHelper
-
-
Method Details
-
get
- Throws:
Exception
-
get
- Throws:
Exception
-
head
- Throws:
Exception
-
delete
- Throws:
Exception
-
post
public RestHttpHelper.HttpResponse post(String url, String requestContent, Map<String, String> headers) throws Exception- Throws:
Exception
-
post
public RestHttpHelper.HttpResponse post(String url, String requestContent, String mimeType, Map<String, String> headers) throws Exception- Throws:
Exception
-
post
public RestHttpHelper.HttpResponse post(String url, InputStream requestContent, String mimeType, long contentLength, Map<String, String> headers) throws Exception- Throws:
Exception
-
put
public RestHttpHelper.HttpResponse put(String url, String requestContent, Map<String, String> headers) throws Exception- Throws:
Exception
-
put
public RestHttpHelper.HttpResponse put(String url, String requestContent, String mimeType, Map<String, String> headers) throws Exception- Throws:
Exception
-
put
public RestHttpHelper.HttpResponse put(String url, InputStream requestContent, String mimeType, long contentLength, Map<String, String> headers) throws Exception- Throws:
Exception
-
multipartFilePost
- Throws:
Exception
-
multipartFileStreamPost
public RestHttpHelper.HttpResponse multipartFileStreamPost(String url, String fileName, InputStream stream) throws Exception - Throws:
Exception
-
multipartPost
public RestHttpHelper.HttpResponse multipartPost(String url, org.apache.http.HttpEntity reqEntity) throws Exception - Throws:
Exception
-