com.meterware.httpunit
Class PostMethodWebRequest
java.lang.Object
|
+--com.meterware.httpunit.WebRequest
|
+--com.meterware.httpunit.MessageBodyWebRequest
|
+--com.meterware.httpunit.PostMethodWebRequest
- public class PostMethodWebRequest
- extends MessageBodyWebRequest
An HTTP request using the POST method.
Method Summary |
protected MessageBody |
getMessageBody()
Subclasses must override this method to provide a message body for the
request. |
String |
getMethod()
Returns the HTTP method defined for this request. |
String |
getQueryString()
Returns the query string defined for this request. |
protected boolean |
maySelectFile(String parameterName)
Returns true if selectFile may be called with this parameter. |
void |
setMimeEncoded(boolean mimeEncoded)
Selects whether MIME-encoding will be used for this request. |
Methods inherited from class com.meterware.httpunit.WebRequest |
getCharacterSet, getHeaders, getParameter, getParameterHolder, getParameterNames, getParameterValues, getRequestParameterNames, getTarget, getURL, getURLBase, getURLString, isFileParameter, isMimeEncoded, removeParameter, selectFile, selectFile, selectFile, setHeaderField, setImageButtonClickPosition, setParameter, setParameter, setParameter, toString |
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 issuedsource
- an input stream which will provide the body of this requestcontentType
- 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.
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.
- Overrides:
setMimeEncoded
in class WebRequest
getMethod
public String getMethod()
- Returns the HTTP method defined for this request.
- Overrides:
getMethod
in class WebRequest
getQueryString
public String getQueryString()
- Returns the query string defined for this request.
- Overrides:
getQueryString
in class WebRequest
maySelectFile
protected boolean maySelectFile(String parameterName)
- Returns true if selectFile may be called with this parameter.
- Overrides:
maySelectFile
in class WebRequest
getMessageBody
protected MessageBody getMessageBody()
- Description copied from class:
MessageBodyWebRequest
- Subclasses must override this method to provide a message body for the
request.
- Overrides:
getMessageBody
in class MessageBodyWebRequest