Package org.kohsuke.github.connector
Interface GitHubConnectorRequest
-
- All Known Implementing Classes:
GitHubRequest
public interface GitHubConnectorRequestA request passed toGitHubConnector.send(GitHubConnectorRequest)to get aGitHubConnectorResponse. Implementers ofGitHubConnector.send(GitHubConnectorRequest)process the information from aGitHubConnectorRequestto open an HTTP connection and retrieve a response. They then return a class that extendsGitHubConnectorResponsecorresponding their response data. Clients should not implement their ownGitHubConnectorRequest. TheGitHubConnectorRequestprovided 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.InputStreambody()Gets the request body as an InputStream.StringcontentType()Get the content type for the body of this request.booleanhasBody()Gets whether the request has information inbody()that needs to be sent.Stringheader(String name)Gets the value contained in a header field.Stringmethod()The request method for this request.URLurl()Gets the url for this request.
-
-
-
Method Detail
-
method
@Nonnull String method()
The request method for this request. For example,GETorPATCH.- 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
nullif 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.
-
-