Interface HttpConnector

All Known Implementing Classes:
HttpConnectorImpl

public interface HttpConnector
An HttpConnector connects to an Http resource sending an optional request and receiving a response.
Author:
Mike Whittaker
  • Method Details

    • connect

      HttpResponse connect(URL url, HttpRequestMethod method, String data, Authenticator authenticator) throws HttpException
      Connects to a URL and obtains a response. Optional data can be sent on the connection. An Authenticator is used to write out the correct authentication headers.
      Parameters:
      url - the endpoint of the request
      method - the Http method to use for the connection
      data - any data that forms the request and which may be null
      authenticator - the Authenticator with which to authenticate the connection
      Returns:
      a response that wraps the status and any response data
      Throws:
      HttpException - if there are any IO problem during the underlying connection or the status code is not 200 (Http okay)