All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.freefair.spring.okhttp.client.OkHttpClientRequestFactory Maven / Gradle / Ivy

There is a newer version: 3.4.0
Show newest version
package io.freefair.spring.okhttp.client;

import okhttp3.OkHttpClient;
import org.springframework.http.HttpMethod;
import org.springframework.http.client.ClientHttpRequest;
import org.springframework.http.client.ClientHttpRequestFactory;
import org.springframework.lang.NonNull;

import java.net.URI;

/**
 * OkHttp based {@link ClientHttpRequestFactory} implementation.
 * 

* Serves as replacement for the deprecated {@link org.springframework.http.client.OkHttp3ClientHttpRequestFactory}. * * @author Lars Grefer */ public record OkHttpClientRequestFactory(@NonNull OkHttpClient okHttpClient) implements ClientHttpRequestFactory { @Override public ClientHttpRequest createRequest(URI uri, HttpMethod httpMethod) { return new OkHttpClientRequest(okHttpClient, uri, httpMethod); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy