public class RequestBuilder
extends java.lang.Object
| Constructor and Description |
|---|
RequestBuilder(java.lang.String host,
java.lang.String path)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
get()
Gets the currently represented request.
|
java.lang.String |
getURI()
Omits the host and the protocol at the beginning of the request.
|
java.lang.String |
toString() |
RequestBuilder |
withHost(java.lang.String host)
Replaces the stored host name.
|
RequestBuilder |
withoutProtocol()
Omits the
http:// at the beginning of the request. |
RequestBuilder |
withQuery(java.lang.String param,
java.lang.String value)
Adds a query to the request, e.g.,
?foo=bar in /my/path?foo=bar. |
public RequestBuilder(java.lang.String host,
java.lang.String path)
host - The host of the request.path - The path of the request.public java.lang.String get()
public RequestBuilder withQuery(java.lang.String param, java.lang.String value)
?foo=bar in /my/path?foo=bar.
Only adds one parameter=value pair. Further pairs can be added by subsequent
calls.param - The parameter name.value - The value of the parameter.public RequestBuilder withHost(java.lang.String host)
host - The new host name.public java.lang.String getURI()
public RequestBuilder withoutProtocol()
http:// at the beginning of the request.public java.lang.String toString()
toString in class java.lang.Object