Interface GitHubConnectorRequest

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 Type
    Method
    Description
    All request headers for this request.
    Gets the request body as an InputStream.
    Get the content type for the body of this request.
    boolean
    Gets whether the request has information in body() that needs to be sent.
    header(String name)
    Gets the value contained in a header field.
    The request method for this request.
    url()
    Gets the url for this request.
  • Method Details

    • method

      @Nonnull String method()
      The request method for this request. For example, GET or PATCH.
      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

      Gets the request body as an InputStream.
      Returns:
      the request body as an InputStream.
    • url

      @Nonnull URL url()
      Gets the url for this request.
      Returns:
      the url for this request.
    • hasBody

      boolean hasBody()
      Gets whether the request has information in body() that needs to be sent.
      Returns:
      true, if the body is not null. Otherwise, false.