Httpclient plug-in on Android studio


UsedIdea / pycharm /... (most of JetBrains' products) Professional EditionStudents may know that they have a built-in plug-in called httpclient.

Use as follows:

newly build xxx.http file

POST http://localhost:8080/xxxx
Content-Type: application/json
Cache-Control: no-cache

{"a":1, "b":2} 

GET http://localhost:8080/xxx?pageNo=2&pageSize=1
Accept: */*Cache-Control: no-cache

stayPOST/GET URLThere will be a green execution icon on the left side of the line. Click to test the interface.

There is no built-in plug-in in the community version and Android studio. After searching, we found one: idea rest client

Httpclient plug-in on Android studio
Image from this plugin warehouse

This plug-in can meet the basic functions, but once you want to transfer form data, the posture is always incorrect, which leads to sending failure all the time. So we started to change the plug-in road.

  1. The first is to use okhttp for request rewriting to support clearer data styles.
  2. Support environment setting and dynamic filling of parameters.

  1. In the later stage, considering that this plug-in is mostly used on Android studio, there is generally retrofit for Android development network framework, so one click generation of retrofit interface class is supported, and Java and kotlin are supported:

Httpclient plug-in on Android studio

  1. However, when there is a large amount of data, it supports downloading to a file and previewing. And big file download…

Httpclient plug-in on Android studio

Last plug-in warehouse address: vove7 / retrofit rest client

You can search and install on the idea Community Edition and Android studio plug-in library: retrofit rest client, or download the plug-in file in the warehouse for local installation.

Recommended Today

Rust and python: why rust can replace Python

In this guide, we compare the rust and python programming languages. We will discuss the applicable use cases in each case, review the advantages and disadvantages of using rust and python, and explain why rust might replace python. I will introduce the following: What is rust? What is Python? When to use rust When to […]