Interface GenHttpRequest
-
public interface GenHttpRequest
Defines the interface of an HTTP request.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addFormParam(java.lang.String key, java.lang.String value)
Adds a form parameter to the request.void
addHeader(java.lang.String key, java.lang.String value)
Adds a request header.GenHttpResponse
execute()
Executes the request and delivers the response.void
setBody(java.lang.String body)
Sets the request body.void
setHttpMethod(HttpMethod httpMethod)
Sets the HTTP method.GenHttpRequest
setUri(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
-
-