Package org.kohsuke.github.connector
Interface GitHubConnectorRequest
-
- All Known Implementing Classes:
GitHubRequest
public interface GitHubConnectorRequest
A request passed toGitHubConnector.send(GitHubConnectorRequest)
to get aGitHubConnectorResponse
. Implementers ofGitHubConnector.send(GitHubConnectorRequest)
process the information from aGitHubConnectorRequest
to open an HTTP connection and retrieve a response. They then return a class that extendsGitHubConnectorResponse
corresponding their response data. Clients should not implement their ownGitHubConnectorRequest
. TheGitHubConnectorRequest
provided by the caller ofGitHubConnector.send(GitHubConnectorRequest)
should be passed to the constructor ofGitHubConnectorResponse
.- Author:
- Liam Newman
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Map<String,List<String>>
allHeaders()
All request headers for this request.InputStream
body()
Gets the request body as an InputStream.String
contentType()
Get the content type for the body of this request.boolean
hasBody()
Gets whether the request has information inbody()
that needs to be sent.String
header(String name)
Gets the value contained in a header field.String
method()
The request method for this request.URL
url()
Gets the url for this request.
-
-
-
Method Detail
-
method
@Nonnull String method()
The request method for this request. For example,GET
orPATCH
.- Returns:
- the request method.
-
allHeaders
@Nonnull Map<String,List<String>> allHeaders()
All request headers for this request.- Returns:
- a map of all headers.
-
header
@CheckForNull String header(String name)
Gets the value contained in a header field.- Parameters:
name
- the name of the field.- Returns:
- the value contained in that field, or
null
if not present.
-
contentType
@CheckForNull String contentType()
Get the content type for the body of this request.- Returns:
- the content type string for the body of this request.
-
body
@CheckForNull InputStream body()
Gets the request body as an InputStream.- Returns:
- the request body as an InputStream.
-
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.
-
-