Class MessageBodyWebRequest
java.lang.Object
com.meterware.httpunit.WebRequest
com.meterware.httpunit.MessageBodyWebRequest
- Direct Known Subclasses:
PostMethodWebRequest, PutMethodWebRequest
A web request which contains a non-empty message body. Note that such requests
must use the
http or https protocols.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA method request message body read directly from an input stream. -
Field Summary
FieldsFields inherited from class WebRequest
method -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMessageBodyWebRequest(WebForm sourceForm) Constructs a web request for a form submitted via script.protectedMessageBodyWebRequest(WebForm sourceForm, com.meterware.httpunit.ParameterHolder parameterHolder, SubmitButton button, int x, int y) Constructs a web request for a form submitted via a button.protectedMessageBodyWebRequest(String urlString, boolean mimeEncoded) Constructs a web request using a specific absolute url string.protectedMessageBodyWebRequest(String urlString, com.meterware.httpunit.protocol.MessageBody messageBody) Constructs a web request using a specific absolute url string.protectedMessageBodyWebRequest(URL urlBase, String urlString, String target, boolean mimeEncoded) Constructs a web request with a specific target. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcompleteRequest(URLConnection connection) Performs any additional processing necessary to complete the request.protected StringReturns the content type of this request.protected com.meterware.httpunit.protocol.MessageBodySubclasses may override this method to provide a message body for the request.booleanReturns true if this request is to be MIME-encoded.protected voidwriteMessageBody(OutputStream stream) Writes the contents of the message body to the specified stream.Methods inherited from class WebRequest
getCharacterSet, getHeaders, getMethod, getParameter, getParameterHolder, getParameterValues, getQueryString, getRequestParameterNames, getTarget, getURL, getURLBase, getURLString, isFileParameter, maySelectFile, removeParameter, selectFile, selectFile, selectFile, setHeaderField, setImageButtonClickPosition, setParameter, setParameter, setParameter, toString
-
Field Details
-
_body
protected com.meterware.httpunit.protocol.MessageBody _body
-
-
Constructor Details
-
MessageBodyWebRequest
Constructs a web request using a specific absolute url string. -
MessageBodyWebRequest
protected MessageBodyWebRequest(String urlString, com.meterware.httpunit.protocol.MessageBody messageBody) Constructs a web request using a specific absolute url string. -
MessageBodyWebRequest
-
MessageBodyWebRequest
protected MessageBodyWebRequest(WebForm sourceForm, com.meterware.httpunit.ParameterHolder parameterHolder, SubmitButton button, int x, int y) Constructs a web request for a form submitted via a button.- Since:
- 1.6
-
MessageBodyWebRequest
Constructs a web request for a form submitted via script.
-
-
Method Details
-
getMessageBody
protected com.meterware.httpunit.protocol.MessageBody getMessageBody()Subclasses may override this method to provide a message body for the request. -
writeMessageBody
Description copied from class:WebRequestWrites the contents of the message body to the specified stream.- Overrides:
writeMessageBodyin classWebRequest- Throws:
IOException
-
completeRequest
Performs any additional processing necessary to complete the request.- Overrides:
completeRequestin classWebRequest- Throws:
IOException
-
getContentType
Description copied from class:WebRequestReturns the content type of this request. If null, no content is specified.- Overrides:
getContentTypein classWebRequest
-
isMimeEncoded
public boolean isMimeEncoded()Description copied from class:WebRequestReturns true if this request is to be MIME-encoded.- Overrides:
isMimeEncodedin classWebRequest
-