|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.meterware.httpunit.WebRequest
A request sent to a web server.
Constructor Summary | |
protected |
WebRequest(String urlString)
Constructs a web request using an absolute URL string. |
protected |
WebRequest(URL urlBase,
String urlString)
Constructs a web request using a base URL and a relative URL string. |
protected |
WebRequest(URL urlBase,
String urlString,
String target)
Constructs a web request using a base URL, a relative URL string, and a target. |
protected |
WebRequest(WebForm sourceForm,
SubmitButton button,
int x,
int y)
Constructs a web request from a form. |
protected |
WebRequest(WebRequestSource requestSource)
|
protected |
WebRequest(WebRequest baseRequest,
String urlString,
String target)
Constructs a web request using a base request and a relative URL string. |
Method Summary | |
protected void |
completeRequest(URLConnection connection)
Performs any additional processing necessary to complete the request. |
protected String |
getCharacterSet()
Returns the character set required for this request. |
protected String |
getContentType()
Returns the content type of this request. |
Dictionary |
getHeaders()
Returns a copy of the headers to be sent with this request. |
abstract String |
getMethod()
Returns the HTTP method defined for this request. |
String |
getParameter(String name)
Returns the value of a parameter in this web request. |
protected ParameterHolder |
getParameterHolder()
|
Enumeration |
getParameterNames()
Deprecated. use getRequestParameterNames instead |
String[] |
getParameterValues(String name)
Returns the multiple default values of the named parameter. |
String |
getQueryString()
Returns the query string defined for this request. |
String[] |
getRequestParameterNames()
Returns an array of all parameter names in this web request. |
String |
getTarget()
Returns the target for this web request. |
URL |
getURL()
Returns the final URL associated with this web request. |
protected URL |
getURLBase()
|
protected String |
getURLString()
|
boolean |
isFileParameter(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(String parameterName)
Returns true if selectFile may be called with this parameter. |
void |
removeParameter(String name)
Removes a parameter from this web request. |
void |
selectFile(String parameterName,
File file)
Sets the file for a parameter upload in a web request. |
void |
selectFile(String parameterName,
File file,
String contentType)
Sets the file for a parameter upload in a web request. |
void |
selectFile(String parameterName,
String fileName,
InputStream inputStream,
String contentType)
Sets the file for a parameter upload in a web request. |
void |
setHeaderField(String headerName,
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. |
protected void |
setMimeEncoded(boolean mimeEncoded)
Selects whether MIME-encoding will be used for this request. |
void |
setParameter(String name,
String value)
Sets the value of a parameter in a web request. |
void |
setParameter(String name,
String[] values)
Sets the multiple values of a parameter in a web request. |
void |
setParameter(String parameterName,
UploadFileSpec[] files)
Sets the multiple values of a file upload parameter in a web request. |
String |
toString()
|
protected void |
writeMessageBody(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 |
Constructor Detail |
protected WebRequest(String urlString)
protected WebRequest(URL urlBase, String urlString)
protected WebRequest(WebRequest baseRequest, String urlString, String target) throws MalformedURLException
protected WebRequest(URL urlBase, String urlString, String target)
protected WebRequest(WebForm sourceForm, SubmitButton button, int x, int y)
protected WebRequest(WebRequestSource requestSource)
Method Detail |
public void setHeaderField(String headerName, String headerValue)
public Dictionary getHeaders()
public URL getURL() throws MalformedURLException
public String getTarget()
public abstract String getMethod()
public String getQueryString()
public void setParameter(String name, String value)
public void setParameter(String name, String[] values)
public void setParameter(String parameterName, 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(String name)
public void selectFile(String parameterName, File file)
public void selectFile(String parameterName, File file, String contentType)
public void selectFile(String parameterName, String fileName, InputStream inputStream, String contentType)
public Enumeration getParameterNames()
public String[] getRequestParameterNames()
public String getParameter(String name)
public String[] getParameterValues(String name)
public void removeParameter(String name)
public String toString()
toString
in class Object
protected boolean maySelectFile(String parameterName)
protected void setMimeEncoded(boolean mimeEncoded)
protected boolean isMimeEncoded()
protected String getContentType()
protected final String getCharacterSet()
protected void completeRequest(URLConnection connection) throws IOException
protected void writeMessageBody(OutputStream stream) throws IOException
protected final URL getURLBase()
protected String getURLString()
protected final ParameterHolder getParameterHolder()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |