com.ephox.editlive.http.manager
Interface HttpManager


public interface HttpManager

Basic HttpManager interface for low-level control over HTTP requests. Instance available via HttpManagerFactory.

NOTE: No caching is performed when using these methods; for cached responses use one of the specific managers.

Since:
7.5

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... nameValuePairs)
          Sends a POST request.
 HttpResponse postFile(URL url, File file)
          Uploads a file using a multipart POST request.
 HttpResponse putFile(URL url, File file)
          Uploads a file using a PUT request.
 

Field Detail

CONTENT_TYPE

static final String CONTENT_TYPE
See Also:
Constant Field Values

CONTENT_ENCODING

static final String CONTENT_ENCODING
See Also:
Constant Field Values

CONTENT_LENGTH

static final String CONTENT_LENGTH
See Also:
Constant Field Values
Method Detail

get

HttpResponse get(URL url)
Sends a GET request.

Parameters:
url - the URL to open a connection to.

post

HttpResponse post(URL url,
                  String charset,
                  NameValuePair... nameValuePairs)
Sends a POST request.

Parameters:
url - the URL to post to.
charset - the character set that will be used to encode POST data
nameValuePairs - fields to send with the post request
Returns:
the response details.

postFile

HttpResponse postFile(URL url,
                      File file)
Uploads a file using a multipart POST request. The file will be uploaded with the form field name "image" unless one is specified in the uploadFileFieldName attribute of the httpUpload configuration file element.

Parameters:
url - the URL to upload to.
file - the file to upload.
Returns:
the response details.

putFile

HttpResponse putFile(URL url,
                     File file)
Uploads a file using a PUT request.

NOTE: As noted in HttpLayer.SUN documentation, this will always use a HttpClient connection.

Parameters:
url - the URL to upload to.
file - the file to upload.
Returns:
the response details.

headRequest

HttpResponse headRequest(URL url)
Sends a HEAD request.

Parameters:
url - the URL to request.
Returns:
the response details.

Copyright (c) 2005-2012 Ephox Pty Ltd. All rights reserved.