Interface GenHttpRequest
-
public interface GenHttpRequestDefines the interface of an HTTP request.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddFormParam(java.lang.String key, java.lang.String value)Adds a form parameter to the request.voidaddHeader(java.lang.String key, java.lang.String value)Adds a request header.GenHttpResponseexecute()Executes the request and delivers the response.voidsetBody(java.lang.String body)Sets the request body.voidsetHttpMethod(HttpMethod httpMethod)Sets the HTTP method.GenHttpRequestsetUri(java.net.URI uri)Sets the request URI.
-
-
-
Method Detail
-
execute
GenHttpResponse execute() throws java.io.IOException
Executes the request and delivers the response.- Returns:
- a new instance of
GenHttpResponse - Throws:
java.io.IOException- when the request failed
-
setUri
GenHttpRequest setUri(java.net.URI uri)
Sets the request URI.- Parameters:
uri- the URI- Returns:
- the same instance of
GenHttpRequest
-
setHttpMethod
void setHttpMethod(HttpMethod httpMethod)
Sets the HTTP method.- Parameters:
httpMethod- the HTTP method
-
addHeader
void addHeader(java.lang.String key, java.lang.String value)Adds a request header.- Parameters:
key- the header namevalue- the header value
-
setBody
void setBody(java.lang.String body)
Sets the request body.- Parameters:
body- the request body as string
-
addFormParam
void addFormParam(java.lang.String key, java.lang.String value)Adds a form parameter to the request.- Parameters:
key- the parameter namevalue- the parameter value
-
-