|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface HttpManager
Basic HttpManager interface for low-level control over HTTP requests. Instance available via HttpManagerFactory
.
Field Summary | |
---|---|
static String |
CONTENT_ENCODING
|
static String |
CONTENT_LENGTH
|
static String |
CONTENT_TYPE
|
Method Summary | |
---|---|
HttpResponse |
get(URL url)
Sends a GET request. |
HttpResponse |
headRequest(URL url)
Sends a HEAD request. |
HttpResponse |
post(URL url,
String charset,
NameValuePair... formFields)
Sends a POST request. |
HttpResponse |
postFile(URL url,
File file)
Uploads a file using a multipart POST request. |
HttpResponse |
postFile(URL url,
File file,
String uploadFileFieldName,
List<NameValuePair> headers,
List<NameValuePair> formFields)
Uploads a file using a multipart POST request with complete control over the request including the uploadFileFieldName. |
HttpResponse |
putFile(URL url,
File file)
Uploads a file using a PUT request. |
Field Detail |
---|
static final String CONTENT_TYPE
static final String CONTENT_ENCODING
static final String CONTENT_LENGTH
Method Detail |
---|
HttpResponse get(URL url)
url
- the URL to open a connection to.HttpResponse post(URL url, String charset, NameValuePair... formFields)
url
- the URL to post to.charset
- the character set that will be used to encode POST dataformFields
- fields to send with the post request
HttpResponse postFile(URL url, File file)
uploadFileFieldName
attribute of the
httpUpload
configuration file element.
Note that as of 8.1.0.133 httpUploadData/httpPostData settings in the configuration are not used here due to availablity of the new method below.
url
- the URL to upload to.file
- the file to upload.
HttpResponse postFile(URL url, File file, String uploadFileFieldName, List<NameValuePair> headers, List<NameValuePair> formFields)
postFile(URL, File)
this API ignores the uploadFileFieldName
attribute in the config.
httpUploadData/httpPostData settings in the configuration are not used here.
url
- the URL to upload to.file
- the file to upload.uploadFileFieldName
- the POST form field name to use for the file.headers
- A list of additional request headers to include.formFields
- A list of form fields, which will be included in the POST form data with content type text/plain.
HttpResponse putFile(URL url, File file)
HttpLayer.SUN
documentation, this will always use a HttpClient connection.
Note that httpUploadData/httpPostData settings in the configuration are not used here.
url
- the URL to upload to.file
- the file to upload.
HttpResponse headRequest(URL url)
url
- the URL to request.
|
Copyright (c) 2005-2012 Ephox Pty Ltd. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |