Class SimpleHttpClientRequest
- java.lang.Object
-
- org.forgerock.http.client.request.SimpleHttpClientRequest
-
- All Implemented Interfaces:
HttpClientRequest
public class SimpleHttpClientRequest extends Object implements HttpClientRequest
A basic implementation ofHttpClientRequest
that a script can send over aHttpClient
.- Since:
- 12.0.0
-
-
Constructor Summary
Constructors Constructor Description SimpleHttpClientRequest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCookie(String domain, String field, String value)
Add a cookie to the request.void
addHeader(String field, String value)
Add a header field to the request.void
addQueryParameter(String field, String value)
Add a query parameter to the request.Set<HttpClientRequestCookie>
getCookies()
Retrieve the cookies set on the request.String
getEntity()
Retrieve the entity set on the request.Map<String,String>
getHeaders()
Retrieve the headers set on the request.String
getMethod()
Retrieve the method set on the request.Map<String,String>
getQueryParameters()
Retrieve the query parameters set on the request.String
getUri()
Retrieve the URI that the request targets.void
setEntity(String entity)
Set the message entity.void
setMethod(String method)
Set the method the request will use.void
setUri(String uri)
Set the URI that the request targets.
-
-
-
Method Detail
-
addHeader
public void addHeader(String field, String value)
Add a header field to the request.- Specified by:
addHeader
in interfaceHttpClientRequest
- Parameters:
field
- The name of the header field to add.value
- The value of the header field.
-
addQueryParameter
public void addQueryParameter(String field, String value)
Add a query parameter to the request.- Specified by:
addQueryParameter
in interfaceHttpClientRequest
- Parameters:
field
- The name of the query parameter field to add.value
- The value of the query parameter field.
-
addCookie
public void addCookie(String domain, String field, String value)
Add a cookie to the request.- Specified by:
addCookie
in interfaceHttpClientRequest
field
- The name of the cookie field to add.value
- The value of the cookie field.
-
setMethod
public void setMethod(String method)
Set the method the request will use.- Specified by:
setMethod
in interfaceHttpClientRequest
- Parameters:
method
- The method to use. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1.1
-
setUri
public void setUri(String uri)
Set the URI that the request targets.- Specified by:
setUri
in interfaceHttpClientRequest
- Parameters:
uri
- The URI of the resource.
-
setEntity
public void setEntity(String entity)
Set the message entity.- Specified by:
setEntity
in interfaceHttpClientRequest
- Parameters:
entity
- The entity.
-
getHeaders
public Map<String,String> getHeaders()
Retrieve the headers set on the request.- Specified by:
getHeaders
in interfaceHttpClientRequest
- Returns:
- The headers set on the request.
-
getQueryParameters
public Map<String,String> getQueryParameters()
Retrieve the query parameters set on the request.- Specified by:
getQueryParameters
in interfaceHttpClientRequest
- Returns:
- The query parameters set on the request.
-
getMethod
public String getMethod()
Retrieve the method set on the request.- Specified by:
getMethod
in interfaceHttpClientRequest
- Returns:
- The method set on the request.
-
getUri
public String getUri()
Retrieve the URI that the request targets.- Specified by:
getUri
in interfaceHttpClientRequest
- Returns:
- The URI that the request targets.
-
getEntity
public String getEntity()
Retrieve the entity set on the request.- Specified by:
getEntity
in interfaceHttpClientRequest
- Returns:
- The entity set on the request.
-
getCookies
public Set<HttpClientRequestCookie> getCookies()
Retrieve the cookies set on the request.- Specified by:
getCookies
in interfaceHttpClientRequest
- Returns:
- The cookies set on the request.
-
-