What is the interface test? doing what? get? post? request

What is the interface test? doing what? get? post? request

What is an interface?

The full name of API is Application Programming Interface, an API is an interface

What is interface testing?

Interface testing is a test for testing the interface between system components. Interface testing is mainly used to detect the interaction points between external systems and systems and between internal subsystems. The focus of the test is to check the data exchange, transfer and control management process, as well as the mutual logical dependence between systems, etc.

Why do interface tests?

  • The lower the bug is found, the lower the repair cost
  • The front end is changed at will, the interface is tested, the back end does not need to be changed, the front and back ends are separated
  • Check the safety and stability of the system
  • Nowadays, the front-end and back-end architectures of many systems are separated. From a security perspective:
    (1) Relying only on the front-end for restrictions can no longer meet the security requirements of the system (it is too easy to bypass the front), and the back-end needs to be controlled as well. In this case, it needs to be verified from the interface level
    (2), whether the front and back transmission, log printing and other information are encrypted and transmitted also need to be verified, especially when it comes to the user’s private information, such as ID cards, bank cards, etc.

How to do interface testing?

Since the front-end and back-end calls of the project are mainly based on the http protocol interface, the testing of the interface is mainly to simulate the sending and receiving of http requests through tools or codes. There are many tools such as postman, jmeter, soupUI, etc.

Other related knowledge

The difference between cookie and session

  • Cookie data is stored on the client's browser, session data is stored on the server
  • Cookie is not very secure, session should be used for security
  • The session will be saved on the server for a certain period of time. When access increases, it will take up the performance of your server
  • Considering to reduce server performance, cookies should be used
  • The data saved by a single cookie cannot exceed 4K, and many browsers limit a site to save a maximum of 20 cookies

The difference between get request and post request

  • GET uses URL or Cookie to pass parameters. And POST puts the data in BODY
  • The GET URL will have a length limitation, while the POST data can be very large
  • POST is safer than GET because the data is not visible on the address bar
  • Generally get requests are used to obtain data, and post requests are used to send data

http status code

  • 200 The beginning of 2 indicates that the request was sent successfully, the most common is 200, which means that the request is ok, and the server also returned
  • 300 The beginning with 3 represents redirection, the most common is 302, which redirects this request to another place
  • 400 400 means that the request sent by the client has a syntax error, 401 means that the accessed page is not authorized, 403 means that there is no permission to access this page, and 404 means that there is no such page.
  • 500 The beginning with 5 represents the server is abnormal, 500 represents the internal server exception, 504 represents the server-side timeout, no result is returned

Guess you like

Origin blog.csdn.net/HONGTester/article/details/108365675