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

Introduction to OkHttp Interceptor (translated from official documents)

1. Introduction to OkHttp interceptor (translated from official documents) Official documentation: https://github.com/square/okhttp/wiki/Interceptors Interceptor is a powerful mechanism provided by OkHttp to process Http requests and responses in a unified way. It can implement functions such as network monitoring, request and response rewriti ...

Posted on Wed, 18 Dec 2019 23:53:20 -0800 by Paingiver

[Android] OkHttp3 summary and encapsulation

Start using Add dependency in build.gradle under app Directory: implementation 'com.squareup.okhttp3:okhttp:3.13.1' implementation 'com.squareup.okio:okio:2.2.2' GET method OkHttpClient client = new OkHttpClient.Builder().build(); Request.Builder builder = new Request.Builder().url(url); builder.method("GET", null); Request request = builder.bu ...

Posted on Fri, 06 Dec 2019 05:36:49 -0800 by Petty_Crim