|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.craftforge.essential.client.ClientRequest
public class ClientRequest
A client request is used to provide a normalized request input for a client.
| Constructor Summary | |
|---|---|
ClientRequest(String httpMethod,
String urlInfoPart)
Creates a client request. |
|
| Method Summary | |
|---|---|
Map<String,String[]> |
getHeaders()
Gets the HTTP request headers. |
String |
getHttpMethod()
Gets the HTTP request method. |
Map<String,String[]> |
getParameters()
Gets the HTTP request parameters. |
InputStream |
getRequestBody()
Gets the HTTP request body. |
String |
getUrlInfoPart()
Gets the request URL info part. |
void |
setAuthorization(String username,
String password)
Sets the HTTP request authorization header. |
void |
setBody(InputStream bodyInputStream,
String mediaType)
Sets the request body input stream for this request and specifies the media type used in the Content-Type header. |
void |
setBody(InputStream bodyInputStream,
String mediaType,
String charset)
Sets the request body input stream for this request and specifies the media type and charset used in the Content-Type header. |
void |
setBody(Object object,
Producer producer,
String mediaType)
Sets the request body for this request and specifies the media type and charset used in the Content-Type header. |
void |
setBody(Object object,
Producer producer,
String mediaType,
String charset)
Sets the request body for this request and specifies the media type and charset used in the Content-Type header. |
void |
setBody(String bodyContent,
String mediaType)
Sets the request body for this request and specifies the media type used in the Content-Type header. |
void |
setBody(String bodyContent,
String mediaType,
String charset)
Sets the request body for this request and specifies the media type and charset used in the Content-Type header. |
void |
setHeader(String headerName,
String headerValue)
Sets the header with the given header name to the specified header value. |
void |
setHeader(String headerName,
String[] headerValues)
Sets the header with the given header name to the specified header values. |
void |
setHeaders(Map<String,String[]> headers)
Sets the headers. |
void |
setParameter(String parameterName,
String parameterValue)
Sets the parameter with the given parameter name to the specified parameter value. |
void |
setParameter(String parameterName,
String[] parameterValues)
Sets the parameter with the given parameter name to the specified parameter values. |
void |
setParameters(Map<String,String[]> parameters)
Sets the parameters. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ClientRequest(String httpMethod,
String urlInfoPart)
httpMethod - The HTTP request methodurlInfoPart - The request URL info part| Method Detail |
|---|
public String getHttpMethod()
public String getUrlInfoPart()
public Map<String,String[]> getHeaders()
public Map<String,String[]> getParameters()
public InputStream getRequestBody()
public void setAuthorization(String username,
String password)
username - The authorization usernamepassword - The authorization password
public void setBody(String bodyContent,
String mediaType)
bodyContent - The body content as a stringmediaType - The media type
public void setBody(String bodyContent,
String mediaType,
String charset)
bodyContent - The body content as a stringmediaType - The media typecharset - The charset
public void setBody(InputStream bodyInputStream,
String mediaType)
bodyInputStream - The body as an input streammediaType - The media type
public void setBody(InputStream bodyInputStream,
String mediaType,
String charset)
bodyInputStream - The body as an input streammediaType - The media typecharset - The charset
public void setBody(Object object,
Producer producer,
String mediaType)
throws ControllerException
object - The request body as an objectproducer - The producer to serialize the objectmediaType - The media type
ControllerException - if the object serialization process fails
public void setBody(Object object,
Producer producer,
String mediaType,
String charset)
throws ControllerException
object - The request body as an objectproducer - The producer to serialize the objectmediaType - The media typecharset - The charset
ControllerException - if the object serialization process fails
public void setHeader(String headerName,
String headerValue)
headerName - The header nameheaderValue - The header value
public void setHeader(String headerName,
String[] headerValues)
headerName - The header nameheaderValues - The header valuespublic void setHeaders(Map<String,String[]> headers)
headers - The headers
public void setParameter(String parameterName,
String parameterValue)
parameterName - The parameter nameparameterValue - The parameter value
public void setParameter(String parameterName,
String[] parameterValues)
parameterName - The parameter nameparameterValues - The parameter valuespublic void setParameters(Map<String,String[]> parameters)
parameters - The parameters
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||