OkHttp source code analysis (builder mode, responsibility chain mode, main process)

Before analyzing the core processes of OkHttp and the core classes, let's clarify two concepts: one is the builder mode used by OkHttpClient and Request when they are created; The other is the interceptor mode responsible for response processing; Analysis of builder mode of OkHttpClient/Request Basic concepts The builder (also known as the b ...

Posted by mass on Sun, 20 Feb 2022 16:10:10 +0100

Preparation for interview I: split Okhttp

okhttp can be said to be the most frequently asked third-party framework in the interview. It should be said that there is no one. It's just time to review and split this third-party library while looking for a job. Part I: design patterns used 1. Builder mode: such as OkHttpClient and Request. Why use the builder model? The use feature of ...

Posted by eyedol on Sat, 19 Feb 2022 16:45:51 +0100

Android: understanding and using OkHttp

OkHttp 1. What is OkHttp 1. Network request development Advantages and disadvantages of Http request Library in history HttpURLConnection—>Apache HTTP Client—>Volley—->okHttp 2. Project open source address https://github.com/square/okhttp 3. What is OkHttp OKhttp is an open source project of network request. And ...

Posted by geek_girl_2020 on Sat, 29 Jan 2022 16:34:34 +0100

Analysis of OkHttp source code (very thin and very long)

prefaceThis article is a detailed analysis of the OkHttp open source library. If you feel you don't know enough about OkHttp, you want to learn more. I believe this article will be helpful to you.This article contains a detailed analysis of the request process, the interpretation of major interceptors and a summary of my reflection. The article ...

Posted by akrocks_extreme on Thu, 16 Dec 2021 18:05:44 +0100

OKHttp3 use principle and source code analysis

brief introduction OKHttp3 is a java and Android network SDK that supports http1 and http2 network protocols. OKHttp relies on OKIO. component 1,OKHttpClient The OKHttpClient class combines multiple objects, implements the Call.Factory interface, provides a newCall method, and returns realcall (the specific implementation class of call). It ...

Posted by storyteller on Fri, 17 Sep 2021 19:54:11 +0200

Android implements request HTTP authentication

These days, the development of external SDK, can achieve landing, payment.Similar to developing a set of QQ, WeChat third party login.The authorization protocol used is OAuth 2.0.Among them, Http Authentication is used, and you can consult the online materials. There are all kinds of answers, some don't know if they have been verified, and some ...

Posted by bradleybebad on Fri, 10 Jul 2020 16:54:06 +0200

OKHttp quick start

OKHttp quick start OKHttp quick start Synchronization request get Asynchronous request get post Set request header Download File encapsulation Interceptor Application interceptor Network connector OKHttp quick start Official website: https://square.github.io/okhttp/ Code warehouse: https:/ ...

Posted by Lodius2000 on Mon, 22 Jun 2020 09:31:27 +0200

Qiniu cloud image upload, configure secondary domain name, support https.

Write in front There are not a few articles about qiniu cloud uploading pictures, but they just use the test domain name given by qiniu cloud. As a webmaster, after upgrading his domain name to https, the obsessive-compulsive patients are not allowed to have the three words of insecurity in the brow ...

Posted by Salis on Wed, 17 Jun 2020 08:52:21 +0200

Simple combination of Retrofit and OkHttp

In our request network, there are many kinds of network request modes, so two kinds of network request modes, Retrofit and OkHttp, can be used together. Both Retrofit and OkHttp are released by Square company. The bottom layer of Retrofit encapsulates OkHttp. I use MVP mode here to encapsulate a network request~~ Custom tool class public cla ...

Posted by jbulaswad on Sun, 31 May 2020 19:11:27 +0200

Self made certificate of Android HTTPS realizes bidirectional authentication (OkHttp + Retrofit + Rxjava)

Due to a high security project to be done recently, it needs to use HTTPS for two-way authentication. When designing the project architecture, the client uses MVVM architecture, and realizes Android based on DataBinding + Retrofit + Rxjava. Looking up a lot of data, there are many examples of implementing two-way authentication based on native ...

Posted by okyejr on Thu, 21 May 2020 06:36:59 +0200