java.lang.Object
org.kohsuke.github.GitHubRequest
- All Implemented Interfaces:
GitHubConnectorRequest
Class
GitHubRequest
represents an immutable instance used by the client to determine what information to
retrieve from a GitHub server. Use the GitHubRequest.Builder
to construct a GitHubRequest
.
NOTE: GitHubRequest
should include the data type to be returned. Any use cases where the same request should
be used to return different types of data could be handled in some other way. However, the return type is currently
not specified until late in the building process, so this is still untyped.
- Author:
- Liam Newman
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionThe headers for this request.apiUrl()
The base GitHub API URL for this request represented as aString
.args()
The arguments for this request.body()
TheInputStream
to be sent as the body of this request.The content type to be sent by this request.boolean
hasBody()
Whether arguments for this request should be included in the URL or in the body of the request.Gets the first value of a header field for this request.The headers for this request.method()
The method for this request, such as "GET", "PATCH", or "DELETE".The rate limit target for this request.url()
TheURL
for this request.urlPath()
The url path to be added to theapiUrl()
for this request.
-
Method Details
-
method
The method for this request, such as "GET", "PATCH", or "DELETE".- Specified by:
method
in interfaceGitHubConnectorRequest
- Returns:
- the request method.
-
rateLimitTarget
The rate limit target for this request.- Returns:
- the rate limit to use for this request.
-
args
The arguments for this request. Depending on themethod()
and#inBody()
these maybe added to the url or to the request body.- Returns:
- the list of arguments
-
allHeaders
The headers for this request.- Specified by:
allHeaders
in interfaceGitHubConnectorRequest
- Returns:
- the
Map
of headers
-
header
Gets the first value of a header field for this request.- Specified by:
header
in interfaceGitHubConnectorRequest
- Parameters:
name
- the name of the header field.- Returns:
- the value of the header field, or
null
if the header isn't set.
-
injectedMappingValues
The headers for this request.- Returns:
- the
Map
of headers
-
apiUrl
The base GitHub API URL for this request represented as aString
.- Returns:
- the url string
-
urlPath
The url path to be added to theapiUrl()
for this request. If this does not start with a "/", it instead represents the full url string for this request.- Returns:
- a url path or full url string
-
contentType
The content type to be sent by this request.- Specified by:
contentType
in interfaceGitHubConnectorRequest
- Returns:
- the content type.
-
body
TheInputStream
to be sent as the body of this request.- Specified by:
body
in interfaceGitHubConnectorRequest
- Returns:
- the
InputStream
.
-
url
TheURL
for this request. This is the actual URL theGitHubClient
will send this request to.- Specified by:
url
in interfaceGitHubConnectorRequest
- Returns:
- the request
URL
-
hasBody
public boolean hasBody()Whether arguments for this request should be included in the URL or in the body of the request.- Specified by:
hasBody
in interfaceGitHubConnectorRequest
- Returns:
- true if the arguments should be sent in the body of the request.
-