|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mmhttp.protocol.RequestBuilder
public class RequestBuilder
While Request is used for parsing requests, this clas is used to build request.
Constructor Summary | |
---|---|
RequestBuilder(java.lang.String resource)
Contructs a new RequestBuilder with the specified resource. |
Method Summary | |
---|---|
void |
addCredentials(java.lang.String username,
java.lang.String password)
Adds digest authentication credentials to the request. |
void |
addHeader(java.lang.String key,
java.lang.String value)
Adds a header to the request. |
void |
addInput(java.lang.String key,
java.lang.Object value)
Add inputs that will be go in the query string. |
void |
addInputAsPart(java.lang.String name,
java.io.InputStream input,
int size,
java.lang.String contentType)
Same as addInputAsPart(String name, Object content) except that this version should be used for large datasets that wouldn't want to load into memory all at once. |
void |
addInputAsPart(java.lang.String name,
java.lang.Object content)
Add the input as multi-part content to the request. |
java.lang.String |
getBoundary()
Build a unique boundary for sparating multi-part content. |
java.lang.String |
getText()
|
java.lang.String |
queryString()
Builds the query string for this request. |
void |
send(java.io.OutputStream output)
Writes an HTTP 1.1 compiant representation of the request to the provided OutputStream. |
void |
setHostAndPort(java.lang.String host,
int port)
Use to build the Host header. |
void |
setMethod(java.lang.String method)
Sets the HTTP method... |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RequestBuilder(java.lang.String resource)
resource
- Method Detail |
---|
public void setMethod(java.lang.String method)
method
- public void addHeader(java.lang.String key, java.lang.String value)
key
- value
- public java.lang.String getText() throws java.lang.Exception
java.lang.Exception
public void send(java.io.OutputStream output) throws java.lang.Exception
output
-
java.lang.Exception
public void addInput(java.lang.String key, java.lang.Object value) throws java.lang.Exception
key
- value
-
java.lang.Exception
public java.lang.String queryString() throws java.lang.Exception
java.lang.Exception
public void addCredentials(java.lang.String username, java.lang.String password) throws java.lang.Exception
username
- password
-
java.lang.Exception
public void setHostAndPort(java.lang.String host, int port)
host
- port
- public java.lang.String getBoundary()
public void addInputAsPart(java.lang.String name, java.lang.Object content) throws java.lang.Exception
name
- content
-
java.lang.Exception
public void addInputAsPart(java.lang.String name, java.io.InputStream input, int size, java.lang.String contentType) throws java.lang.Exception
name
- input
- size
- - number of bytes in the input streamcontentType
- - for the Content-Type header
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |