[Interface Test] Postman —— Interface Test Knowledge Preparation

1.0 Preface

​Application Programming Interface (Application Programming Interface, API) is one of the most popular technologies in these years. Powerful web applications and leading mobile applications are inseparable from powerful APIs on the back end. The application of API technology has brought convenience to system development, but it also puts forward higher requirements for testers. How to test these APIs in an effective way and ensure that they operate as expected is the main problem facing testers at present. .

​Today we will introduce some concepts of interface testing and some technical terms, etc.

1.1 Interface testing concept

1.1 Interface test

Interface testing is a type of testing that tests the interfaces between system components. Interface testing is mainly used to detect the interaction points between external systems and internal subsystems. The focus of the test is to check the exchange of data, the process of delivery and control management, and the mutual logical dependencies between the systems.

1.2 The principle of interface testing

​The tester uses auxiliary tools to simulate the client sending a request message to the server. After the server accepts the request message, it processes the corresponding message and returns a response to the client. The tool simulates the client to accept the response, and then the tester Check that the answer is correct

1.4 Common interface testing tools

  • Postman
  • Jmeter
  • eolinker
  • doclever
  • test

Here we use Postman

1.2 Basic knowledge of interface testing

1.2.1 Definition of interface

​As the name suggests, an interface is to connect two different systems or two different functions in one system, and the part that connects them is called an interface.

1.2.2 Classification of interfaces

(1) HTTP interface

​ It is an interface developed based on the Hypertext Transfer Protocol (HTTP), but it does not exclude that other protocols are not used.

(2) Web Service interface

​ It is the external interface of the system. For example, if you want to obtain resources from other websites or servers, generally speaking, others will not share the database with you. They will provide a method they have written for you to use to obtain data. , you can refer to the interface they provide by using the method they wrote, so as to achieve the purpose of synchronizing data

(3) RESTful interface

​ REST for short, which describes an architectural style network system, the core is resource-oriented. REST is specially designed and developed for network applications, reducing the complexity of development and improving the scalability of the system.

1.2.3 HTTP request

​ HTTP request consists of four parts: uniform resource locator (URL), method (Method), header (Headers) and body (Body)

1 Uniform Resource Locator (URL)

​ Everyone should be familiar with the URL, so we don’t waste space here, just skip it

2 Method

​ Here, there are instructions in the performance test knowledge preparation post before the blogger, please move to check

3 Header and Body

​The HTTP message is text-oriented, and each field in the message is an ASCII code string, and the length of each field is uncertain. An HTTP request message consists of four parts: request line, header, blank line, and request data. The general format of a request message is as follows.

http

<request-line>
<headers>
<blank line>
[<request-body>]
 
 

1.2.4 HTTP response

​ After sending the HTTP request to the server, the server will give a corresponding response, and the response message returned by the server is called the HTTP response

1 HTTP response message

​ The HTTP response message consists of 3 parts, namely: status line, message header and response body . The format of the HTTP response is very similar to the format of the request, as follows:

http

<status-line>
<headers>
<blank line>
[<response-body>]
 
 

The status line format is HTTP-Version Status-Code Reason-Phrase CRLF

  • HTTP-Version****: server HTTP version
  • Status-Code: The response status code returned by the server
  • Reason-Phrase: Indicates a textual description of the status code
  • CRLF: Represents a carriage return and a line feed

As for the status code, it was also introduced before, so please move around

2 JSON

(1) Definition of JS object tag

JS Object Notation (JavaScript Object Notation, JSON) is a lightweight data exchange format. It is based on a subset of ECMAScript (the JavaScript specification developed by W3C), and uses a text format that is completely independent of the coding language to store and prompt data. The introduction and clear hierarchical structure make JSON an ideal data exchange language. It is easy to read and write, and it is also easy to parse and generate by machine, and can effectively improve the efficiency of network transmission. Therefore, HTTP interface responses are generally in JSON format.

(2) JSON syntax rules

​ JSON grammar rules include saving objects with braces, representing objects with key-value pairs, separating each object with commas, and saving arrays with square brackets

(3) JSON example

json

{"name": "storm", "age": "32", "sex": "male"}

As for the download and installation of Postman, just download and install directly from the official website, and install silently.

This is our simple knowledge ready

The above is the whole content of this section, if there is any mistake, please correct me!


If the article is helpful to you, remember to like, bookmark, and add attention. I will share some dry goods from time to time...

END Supporting Learning Resources Sharing

Finally:  In order to give back to the die-hard fans, I have compiled a complete software testing video learning tutorial for you. If you need it, you can get it for free 【保证100%免费】

Software Testing Interview Documentation

We must study to find a high-paying job. The following interview questions are the latest interview materials from first-tier Internet companies such as Ali, Tencent, and Byte, and some Byte bosses have given authoritative answers. Finish this set The interview materials believe that everyone can find a satisfactory job.

insert image description here

How to obtain the full set of information:

Guess you like

Origin blog.csdn.net/IT_LanTian/article/details/131287387