|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.meterware.httpunit.WebRequest
A request sent to a web server.
Field Summary | |
protected java.lang.String |
method
the HTTP method defined for this request e.g. |
Constructor Summary | |
protected |
WebRequest(java.lang.String urlString)
Constructs a web request using an absolute URL string. |
protected |
WebRequest(java.net.URL urlBase,
java.lang.String urlString)
Constructs a web request using a base URL and a relative URL string. |
protected |
WebRequest(java.net.URL urlBase,
java.lang.String urlString,
FrameSelector frame,
java.lang.String target)
Constructs a web request using a base URL, a relative URL string, and a target. |
protected |
WebRequest(java.net.URL urlBase,
java.lang.String urlString,
java.lang.String target)
Constructs a web request using a base URL, a relative URL string, and a target. |
protected |
WebRequest(WebForm sourceForm,
com.meterware.httpunit.ParameterHolder parameterHolder,
SubmitButton button,
int x,
int y)
Constructs a web request from a form. |
protected |
WebRequest(WebRequestSource requestSource,
com.meterware.httpunit.ParameterHolder parameterHolder)
|
protected |
WebRequest(WebRequest baseRequest,
java.lang.String urlString,
java.lang.String target)
Constructs a web request using a base request and a relative URL string. |
protected |
WebRequest(WebResponse referer,
org.w3c.dom.Element sourceElement,
java.net.URL urlBase,
java.lang.String urlString,
java.lang.String target)
Constructs a web request using a base URL, a relative URL string, and a target. |
Method Summary | |
protected void |
completeRequest(java.net.URLConnection connection)
Performs any additional processing necessary to complete the request. |
protected java.lang.String |
getCharacterSet()
Returns the character set required for this request. |
protected java.lang.String |
getContentType()
Returns the content type of this request. |
java.util.Dictionary |
getHeaders()
Returns a copy of the headers to be sent with this request. |
java.lang.String |
getMethod()
|
java.lang.String |
getParameter(java.lang.String name)
Returns the value of a parameter in this web request. |
protected com.meterware.httpunit.ParameterHolder |
getParameterHolder()
|
java.lang.String[] |
getParameterValues(java.lang.String name)
Returns the multiple default values of the named parameter. |
java.lang.String |
getQueryString()
Returns the query string defined for this request. |
java.lang.String[] |
getRequestParameterNames()
Returns an array of all parameter names defined as part of this web request. |
java.lang.String |
getTarget()
Returns the target for this web request. |
java.net.URL |
getURL()
Returns the final URL associated with this web request. |
protected java.net.URL |
getURLBase()
|
protected java.lang.String |
getURLString()
|
boolean |
isFileParameter(java.lang.String name)
Returns true if the specified parameter is a file field. |
protected boolean |
isMimeEncoded()
Returns true if this request is to be MIME-encoded. |
protected boolean |
maySelectFile(java.lang.String parameterName)
Returns true if selectFile may be called with this parameter. |
void |
removeParameter(java.lang.String name)
Removes a parameter from this web request. |
void |
selectFile(java.lang.String parameterName,
java.io.File file)
Sets the file for a parameter upload in a web request. |
void |
selectFile(java.lang.String parameterName,
java.io.File file,
java.lang.String contentType)
Sets the file for a parameter upload in a web request. |
void |
selectFile(java.lang.String parameterName,
java.lang.String fileName,
java.io.InputStream inputStream,
java.lang.String contentType)
Sets the file for a parameter upload in a web request. |
void |
setHeaderField(java.lang.String headerName,
java.lang.String headerValue)
Sets the value of a header to be sent with this request. |
void |
setImageButtonClickPosition(int x,
int y)
Specifies the click position for the submit button. |
void |
setParameter(java.lang.String name,
java.lang.String value)
Sets the value of a parameter in a web request. |
void |
setParameter(java.lang.String name,
java.lang.String[] values)
Sets the multiple values of a parameter in a web request. |
void |
setParameter(java.lang.String parameterName,
com.meterware.httpunit.protocol.UploadFileSpec[] files)
Sets the multiple values of a file upload parameter in a web request. |
java.lang.String |
toString()
|
protected void |
writeMessageBody(java.io.OutputStream stream)
Writes the contents of the message body to the specified stream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.lang.String method
Constructor Detail |
protected WebRequest(java.lang.String urlString)
protected WebRequest(java.net.URL urlBase, java.lang.String urlString)
protected WebRequest(WebRequest baseRequest, java.lang.String urlString, java.lang.String target) throws java.net.MalformedURLException
protected WebRequest(java.net.URL urlBase, java.lang.String urlString, java.lang.String target)
protected WebRequest(WebResponse referer, org.w3c.dom.Element sourceElement, java.net.URL urlBase, java.lang.String urlString, java.lang.String target)
protected WebRequest(java.net.URL urlBase, java.lang.String urlString, FrameSelector frame, java.lang.String target)
protected WebRequest(WebForm sourceForm, com.meterware.httpunit.ParameterHolder parameterHolder, SubmitButton button, int x, int y)
sourceForm
- - the WebForm to startFromparameterHolder
- - the parameter holderbutton
- - the submit buttonx
- - x positiony
- - y positionprotected WebRequest(WebRequestSource requestSource, com.meterware.httpunit.ParameterHolder parameterHolder)
Method Detail |
public void setHeaderField(java.lang.String headerName, java.lang.String headerValue)
headerName
- - the name of the headerheaderValue
- - the value to be setpublic java.util.Dictionary getHeaders()
public java.net.URL getURL() throws java.net.MalformedURLException
java.net.MalformedURLException
- if the URL is not o.k.public java.lang.String getTarget()
public java.lang.String getMethod()
public java.lang.String getQueryString()
public void setParameter(java.lang.String name, java.lang.String value)
public void setParameter(java.lang.String name, java.lang.String[] values)
public void setParameter(java.lang.String parameterName, com.meterware.httpunit.protocol.UploadFileSpec[] files)
public void setImageButtonClickPosition(int x, int y) throws IllegalRequestParameterException
IllegalRequestParameterException
- thrown if the request was not created from a form with an image button.public boolean isFileParameter(java.lang.String name)
public void selectFile(java.lang.String parameterName, java.io.File file)
public void selectFile(java.lang.String parameterName, java.io.File file, java.lang.String contentType)
public void selectFile(java.lang.String parameterName, java.lang.String fileName, java.io.InputStream inputStream, java.lang.String contentType)
public java.lang.String[] getRequestParameterNames()
public java.lang.String getParameter(java.lang.String name)
public java.lang.String[] getParameterValues(java.lang.String name)
public void removeParameter(java.lang.String name)
public java.lang.String toString()
protected boolean maySelectFile(java.lang.String parameterName)
protected boolean isMimeEncoded()
protected java.lang.String getContentType()
protected final java.lang.String getCharacterSet()
protected void completeRequest(java.net.URLConnection connection) throws java.io.IOException
java.io.IOException
protected void writeMessageBody(java.io.OutputStream stream) throws java.io.IOException
java.io.IOException
protected final java.net.URL getURLBase()
protected java.lang.String getURLString()
protected final com.meterware.httpunit.ParameterHolder getParameterHolder()
|
Copyright © 2000-2008 Russell Gold. See license agreement for rights granted. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |