Spring Cloud - Load Balancing Ribbon and Remote Call Feign principles and examples

Previous: Principle and Example of Spring Cloud-Eureka Registration Center Official website: https://cloud.spring.io/spring-cloud-static/spring-cloud-netflix/2.2.1.RELEASE/reference/html/#spring-cloud-ribbon In the front-end and back-end separation architecture, the service layer is divided into a numbe ...

Posted by cbcampbell on Mon, 24 Feb 2020 19:04:49 -0800

Detailed process and implementation of Github third party login

1, Flow chart 2, Specific implementation steps I. create OAuth App First of all, we need to create an OAuth App. Click according to the steps below Fill in the information in turn, and then click Register application Then we can see that an id and password will be generated, which will be used later. Try not to let others see it (I'm he ...

Posted by labmixz on Fri, 14 Feb 2020 07:35:57 -0800

How to remove the request header parameters automatically added by user agent, accept encoding and other frameworks from OkHttp

When using the OkHttp network framework to make network requests, we will find that there will be several additional parameters in the request header sent to the background than we added ourselves. Check the source code and you will find private Response getResponseWithInterceptorChain() throws IOException { // Build a fu ...

Posted by runfastrick on Thu, 13 Feb 2020 11:42:52 -0800

Android advanced notes -- Retrofit source code analysis

Article directory I. information Two, introduction Three. Introduction 4, Source code analysis 4.1. Create retrofit 4.1.1. Building 4.1.2. Add baseUrl 4.1.3. Add GsonConverterFactory 4.1.4.build() 4.2. Create network request 4.3. Call the network request API, generate a call, and execute the reque ...

Posted by jandrews on Wed, 29 Jan 2020 04:17:57 -0800

Source analysis of Android mainstream triplet libraries (3. Deep understanding of Glide source)

Preface To be a great Android developer, you need a complete Knowledge System Here, let's grow up as we want. tips: articles are too long to favor your collection first, then read them slowly ~ In the first two chapters, we have analyzed the core source code of OKHttp, the underlying framework of A ...

Posted by GetReady on Thu, 16 Jan 2020 18:29:25 -0800

Kotlin okhttp simple package

The first time I wrote a blog, I felt a little excited. Mainly make a record of the process of learning Kotlin. After all, a good memory is better than a bad pen. Although I haven't done it all the time, this may be the beginning. Add dependency: implementation 'com.squareup.okhttp3:okhttp:3.1.2' implementation 'org.jet ...

Posted by Buddha443556 on Mon, 06 Jan 2020 03:43:08 -0800

Android uses HTTP protocol to access the network

At present, there are two commonly used methods to send HTTP requests, one is HttpURLConnection (official recommended usage), the other is OkHttp (developed by Square) The first method: Get HttpURLConnection instance URL url = new URL("https://www.baidu.com"); connection = (HttpURLConnection) url.openConnection(); Set the m ...

Posted by tlavelle on Mon, 30 Dec 2019 23:31:54 -0800

Combination of Retrofit and RxJava

These two frameworks are very popular now. The combination of strong and strong forces makes our efficiency more direct First, we need to import the dependencies implementation 'com.squareup.retrofit2:retrofit:2.4.0' implementation 'com.squareup.okhttp3:okhttp:3.11.0' implementation 'com.google.code.gson:gson:2.8. ...

Posted by 25lez25 on Tue, 17 Dec 2019 10:14:25 -0800

Get messages from the server regularly

Function Description: There is a message function in the interface. Click message to view the message list. Regularly send the request interface to the server to obtain the latest messages, and display the number of messages in the form of corner marks to the message function, Thus, users can intuitively know that they have received several m ...

Posted by vidhu on Fri, 13 Dec 2019 07:04:20 -0800

engine mode encapsulates the asynchronous GET of OkHttp

OkHttpEngine First, OkHttp is obtained through the singleton mode. The singleton pattern has a private constructor and a static get method. Let's see what we've done in the constructor first. private OkHttpEngine(Context context) { File sdcache = context.getExternalCacheDir(); int cacheSize = 10 * 1024 * 102 ...

Posted by cameeob2003 on Wed, 20 Nov 2019 07:18:15 -0800