Package com.styra.opa.openapi.utils
Interface HTTPClient
- All Known Implementing Classes:
OPAHTTPClient
,OPALatencyMeasuringHTTPClient
,RecordingClient
,SpeakeasyHTTPClient
public interface HTTPClient
-
Method Summary
Modifier and TypeMethodDescriptionsend
(HttpRequest request) Sends an HTTP request and returns the response.
-
Method Details
-
send
HttpResponse<InputStream> send(HttpRequest request) throws IOException, InterruptedException, URISyntaxException Sends an HTTP request and returns the response.Note that
HttpRequest
is immutable. To modify the request you can useHttpRequest.newBuilder(HttpRequest, BiPredicate<String, String>)
with JDK 16 and later (which will copy the request for modification in a builder). If that method is not available then useHelpers.copy(java.net.http.HttpRequest)
(which also returns a builder).- Parameters:
request
- HTTP request- Returns:
- HTTP response
- Throws:
IOException
InterruptedException
URISyntaxException
-