OkHttp3 source code (2) ------ Request

Chapter I OkHttp3 source code (I) -- OkHttpClient It's a great honor to receive comments and attention. Next, we will analyze another commonly used class of OkHttp3 - Request. From the name, this class knows that it is a Request. What specific Request information can be set? What is its main purpose? If you don't know much abo ...

Posted on Wed, 01 Apr 2020 14:34:34 -0700 by jesseledwards

OkHttp Configure HTTPS Access+Server Deployment

1 Overview OkHttp configures HTTPS access with three core components: sslSocketFactory() HostnameVerifier X509TrustManager The first is the ssl socket factory, the second is to validate the host name, the third is the certificate trustor management class. Implementing HTTPS access through OkHttp requires that you implement these three parts y ...

Posted on Sun, 29 Mar 2020 13:00:51 -0700 by vfwood

Spring Cloud explains Feign's core principles and performance optimization

1. introduction Feign is a lightweight framework for HTTP request calling, which can call HTTP request by java interface annotation instead of directly calling by encapsulating HTTP request message in Java. Feign templates the request by processing comments. When it is actually called, it passes in ...

Posted on Fri, 31 Jan 2020 23:51:30 -0800 by watson516

OKHttpUtils of Android framework

OKHttpUtils is a encapsulation class of OKHttp. OKHttp has many functions, such as file upload and download, text data request get and submit post, Download picture, etc   Three jar packages need to be imported: okhttp-3.4.1.jar, okhttputils-2 ﹣ 6 ﹣ 2.jar, and okio-1.9.0.jar. I have collected them. Here is the download addr ...

Posted on Thu, 30 Jan 2020 08:01:42 -0800 by show8bbs

Take you step by step through Retrofit source parsing: a network request framework based on OkHttp

What is the difference and connection between OkHttp and Retrofit? Reference Answer:OkHttp and Retrofit are both popular open source frameworks for networks Packaging is different:Retrofit encapsulates specific requests, thread switching, and data conversion.retrofit encapsulates okhttp using proxy, appearance, and policy patternsOkHttp is a s ...

Posted on Tue, 07 Jan 2020 10:33:13 -0800 by fox_m

Appreciation of Android wheel's Retrofit source code

Implementation of Service interface in Retrofit For custom Service classes: public interface GithubService { @GET("users/{user}/repos") MyCall<String> listRepos(@Path("user") String user); } When used: GithubService githubService = retrofit.create(GithubService.class); MyCall<String> call = githubSer ...

Posted on Thu, 02 Jan 2020 11:20:01 -0800 by Vball

Analysis of OkHttp source code

OkHttp use code instance private static final MediaType JSON = MediaType.parse("application/json; charset=utf-8"); OkHttpClient client = new OkHttpClient(); String post(String url, String json) throws IOException { RequestBody body = RequestBody.create(JSON, json); Request request = new Request.Builder() ...

Posted on Wed, 01 Jan 2020 07:31:32 -0800 by allex01

json parsing error after confusion

After the obfuscation is enabled, the package is packed, and the program has json parsing error Reason: the model to be resolved is not configured to be ignored. (gson has been configured to ignore files and generics) Solution # Own project configuration: when using Gson, you need to configure the parsing objects and variable ...

Posted on Wed, 01 Jan 2020 05:19:30 -0800 by fewtrem

Android's adaptation to Retrofit's BaseUrl

Android's adaptation to Retrofit's BaseUrl In a project, you may encounter interfaces that call different domain names or ports, but Retrofit's setting method for BaseUrl does not provide adaptation for different domain names. Our network calls are generally single examples, so it is impossible to build an instance for each do ...

Posted on Wed, 25 Dec 2019 13:59:00 -0800 by fxb9500

Examples of Retrofit and Rxjava

Environmental configuration Add the following dependencies under build.gradle of Module:app, and then sync now. Some of the following dependencies are not used. There is no mistake in adding them temporarily. dependencies { implementation 'com.squareup.retrofit2:retrofit:2.4.0' implementation 'com.squareup.retrofit2:a ...

Posted on Mon, 23 Dec 2019 08:37:01 -0800 by Jocke