Class OPAHTTPClient

java.lang.Object
com.styra.opa.utils.OPAHTTPClient
All Implemented Interfaces:
HTTPClient
Direct Known Subclasses:
OPALatencyMeasuringHTTPClient

public class OPAHTTPClient extends Object implements HTTPClient
This HTTPClient implementation also injects additional headers provided to its constructor into each HTTP request that it sends. This is meant to be used as the HTTP client implementation for instances of the Speakeasy generated OPA SDK.
  • Constructor Details

    • OPAHTTPClient

      public OPAHTTPClient(Map<String,String> extraHeaders)
      Instantiates a new HTTP client suitable for use with the Speakeasy SDK, but with additional headers included in every request.
      Parameters:
      extraHeaders - The extra headers to include.
    • OPAHTTPClient

      public OPAHTTPClient()
      If instantiated with this constructor, OPAHTTPClient will be initialized with an empty list of extra headers to inject.
  • Method Details