What are the types of interfaces?

Interfaces are generally divided into two types: 1. Internal interface of the program 2. External interface of the system

External interface of the system: for example, if you want to get resources or information from other websites or servers, others will not share the database with you. They can only provide you with a method to obtain data written by them. You can use the interface provided by him to achieve the purpose of data sharing.

Within the program interface: between the approach and method, the interaction between the module and module, thrown within the program interface, such as BBS system, has the login module, Posting module, etc., that you want to post you must login first, then the two modules have to have interaction, it throws an interface, the calling for internal system.

Interfaces are classified as follows: webService interface 2. HTTP API interface

The webService interface is transmitted through HTTP through SOAP protocol, and the request message and return message are in XML format. We use the tool to call and test when testing.

HTTP API uses THE HTTP protocol to distinguish the invocation methods by the path. The request packets are in the form of key-value, and the return packets are usually JSON strings, including get and POST, which are the two most commonly used request methods.

Json is a universal data type that all languages recognize. (Json is essentially a string that has nothing to do with any other language, but can be converted to a dictionary in Python, key-value form, native object in JavaScript, Java class object, etc.)

Interfaces – front end, back end and test

The front end uses the interface: Ajax design is carried out through the interface document given by the back-end personnel, and requests are sent to the service through the interface to obtain the response data, and then the next page jump and display is carried out through the returned data.

Back-end generated interfaces: Write interfaces that provide a channel for the front end to interact with the server and data requests. Write corresponding interfaces, parameters to be passed, parameter types and so on. The interface document is then generated and shared with the front end so that it can write corresponding Ajax based on the interface document.

Test validation interface: can through the interface documentation, verifies the interface, view the backend interface development and front-end Ajax is written by the corresponding, if there is any error interface, but also through the interface flow testing, know is corresponding to the interfaces between the whole system, any interface is wrong, or no normal operation.

Front end, back end and test interface tools

Front end: Postman, APIPost, or JMeter are generally used for interface validation and viewing response values

Back-end: Use swagger, APIPost, Postman and other interface document generation tools and test tools

Testing: JMeter, APIPost, Postman, and others can perform validation tests on interfaces.

Iv. Introduction to JMeter, Postman, APIPost, Swagger tools

Jmeter can be used for interface testing and performance testing, but for pure interface testing jMeter is not as convenient as Postman and APIPost. Jmeter focuses on stress testing, stability testing and load testing. Aimed at the stability of the interface and program design of a piece of software performance as the main interface test as a secondary interface testing tool.

Postman is an interface testing plugin developed by Google, which also has a client. Postman’s plugin became hard to download and use after Google was banned in China. Postman this interface test tool, is a very portable interface verification tool, you can input the request method, URL, parameters directly interface request access, verify whether the interface is open, you can also view the returned response value to check whether the interface development is normal. But because it is developed by Google, it only supports English version. It is particularly uncomfortable to use for those who do not speak English well.

Apipost this interface testing tool, mainly for interface verification and interface document generation. Apipost this interface test tool, is a very lightweight interface verification tool, you can directly access the interface request by entering the request method, URL, parameters, verify whether the interface is open, you can also view the returned response value to check whether the interface development is normal. Based on the interface verification information, online documents and offline versions of Word documents can be generated directly. Swagger is a great interface test and interface document generation tool, unlike swagger generated interface documents are not easy to read. Apipost also has the ability to work cooperatively and can effectively realize the interface tuning of the front end.

Swagger is an interface document generation tool for backend developers. A tool that generates interface documentation primarily from comments in code, but in English.

Download address:

jmeter:jmeter.apache.org/

Apipost: www.apipost.cn/?dt=2020103…

swagger:swagger.io/