com.jdroid.java.http.okhttp.OkHttpService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jdroid-java-http-okhttp Show documentation
Show all versions of jdroid-java-http-okhttp Show documentation
OKHttp Http Layer Implementation for Jdroid
The newest version!
package com.jdroid.java.http.okhttp;
import com.jdroid.java.http.AbstractHttpService;
import com.jdroid.java.http.HttpResponseWrapper;
import com.jdroid.java.http.HttpService;
import com.jdroid.java.http.HttpServiceProcessor;
import com.jdroid.java.http.Server;
import com.jdroid.java.http.parser.Parser;
import com.jdroid.java.utils.LoggerUtils;
import com.jdroid.java.utils.StringUtils;
import java.io.InputStream;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import okhttp3.Interceptor;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.ResponseBody;
public abstract class OkHttpService extends AbstractHttpService {
static {
// This is to avoid exceptions like "java.net.ProtocolException: Unexpected status line:..." that occurs in some
// cases when HTTP connections are reused. This issue, according to the tests carried out, seems to happen in the app
// only in some cases when a connection is reused after a response code 204.
System.setProperty("http.keepAlive", "false");
}
private static OkHttpClient OK_HTTP_CLIENT_PROTOTYPE;
protected OkHttpClient client;
protected Request request;
private List networkInterceptors;
public OkHttpService(Server server, List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy