use of com.algolia.search.models.HttpRequest in project algoliasearch-client-java-2 by algolia.
the class JavaNetHttpRequester method buildRequest.
/**
* Builds an http request from an AlgoliaRequest object
*
* @param algoliaRequest The Algolia request object
*/
private java.net.http.HttpRequest buildRequest(@Nonnull HttpRequest algoliaRequest) {
java.net.http.HttpRequest.Builder builder = java.net.http.HttpRequest.newBuilder();
buildHeaders(builder, algoliaRequest.getHeaders());
buildURI(builder, algoliaRequest.getUri());
builder.timeout(Duration.ofMillis(algoliaRequest.getTimeout()));
BodyPublisher body = buildRequestBody(builder, algoliaRequest);
builder.method(algoliaRequest.getMethod().toString(), body);
return builder.build();
}
Aggregations