- All Known Implementing Classes:
GitHubRequest
public interface GitHubConnectorRequest
A request passed to
GitHubConnector.send(GitHubConnectorRequest) to get a GitHubConnectorResponse.
Implementers of GitHubConnector.send(GitHubConnectorRequest) process the information from a
GitHubConnectorRequest to open an HTTP connection and retrieve a response. They then return a class that
extends GitHubConnectorResponse corresponding their response data.
Clients should not implement their own GitHubConnectorRequest. The GitHubConnectorRequest provided by
the caller of GitHubConnector.send(GitHubConnectorRequest) should be passed to the constructor of
GitHubConnectorResponse.- Author:
- Liam Newman
-
Method Summary
Modifier and TypeMethodDescriptionAll request headers for this request.body()Gets the request body as an InputStream.Get the content type for the body of this request.booleanhasBody()Gets whether the request has information inbody()that needs to be sent.Gets the value contained in a header field.method()The request method for this request.url()Gets the url for this request.
-
Method Details
-
allHeaders
All request headers for this request.- Returns:
- a map of all headers.
-
body
Gets the request body as an InputStream.- Returns:
- the request body as an InputStream.
-
contentType
Get the content type for the body of this request.- Returns:
- the content type string for the body of this request.
-
hasBody
boolean hasBody()Gets whether the request has information inbody()that needs to be sent.- Returns:
- true, if the body is not null. Otherwise, false.
-
header
Gets the value contained in a header field.- Parameters:
name- the name of the field.- Returns:
- the value contained in that field, or
nullif not present.
-
method
The request method for this request. For example,GETorPATCH.- Returns:
- the request method.
-
url
Gets the url for this request.- Returns:
- the url for this request.
-