com.meterware.httpunit

Class PostMethodWebRequest

public class PostMethodWebRequest extends MessageBodyWebRequest

An HTTP request using the POST method.
Constructor Summary
PostMethodWebRequest(String urlString)
Constructs a web request using a specific absolute url string.
PostMethodWebRequest(String urlString, InputStream source, String contentType)
Constructs a web request using a specific absolute url string and input stream.
PostMethodWebRequest(URL urlBase, String urlString, String target)
Constructs a web request with a specific target.
Method Summary
protected MessageBodygetMessageBody()
StringgetMethod()
Returns the HTTP method defined for this request.
StringgetQueryString()
Returns the query string defined for this request.
protected booleanmaySelectFile(String parameterName)
Returns true if selectFile may be called with this parameter.
voidsetMimeEncoded(boolean mimeEncoded)
Selects whether MIME-encoding will be used for this request.

Constructor Detail

PostMethodWebRequest

public PostMethodWebRequest(String urlString)
Constructs a web request using a specific absolute url string.

PostMethodWebRequest

public PostMethodWebRequest(String urlString, InputStream source, String contentType)
Constructs a web request using a specific absolute url string and input stream.

Parameters: urlString the URL to which the request should be issued source an input stream which will provide the body of this request contentType the MIME content type of the body, including any character set

PostMethodWebRequest

public PostMethodWebRequest(URL urlBase, String urlString, String target)
Constructs a web request with a specific target.

Method Detail

getMessageBody

protected MessageBody getMessageBody()

getMethod

public String getMethod()
Returns the HTTP method defined for this request.

getQueryString

public String getQueryString()
Returns the query string defined for this request.

maySelectFile

protected boolean maySelectFile(String parameterName)
Returns true if selectFile may be called with this parameter.

setMimeEncoded

public void setMimeEncoded(boolean mimeEncoded)
Selects whether MIME-encoding will be used for this request. MIME-encoding changes the way the request is sent and is required for requests which include file parameters. This method may only be called for a request which was not created from a form.