Python API Interface Test

Source: Internet
Author: User
Tags curl

First, the use of postman

1. Install, postman is a chrome plugin that can be installed in the Chrome extension-------Baidu

Here's a tip: at work, we may often encounter some 404,500 or other errors that we can't parse, and we can send the interface copy to curl and send it to the developer to help us find the answer.

The developer tool found the wrong interface, Copy-curl

Postman:import to Postman. You can send it directly.

Second, set global variables

After setting the global variable, you can see the global variables you set in the right eye, and of course add environment

{{URL}} This format can refer to the URL global variable eg:{{URL}}/topics/

Third, after setting the global variables, we can make reference

as follows, referring to the URL of this global variable, and then found that the operation requires login, so we can add to them in authorization login; Of course we generally use token, cookie class control login

Iv. Validation and correlation

A test without validation is incomplete and meaningless: The following is the postman tests's verification instructions

Sometimes we need to use the correlation so that later requests can also invoke the content generated by the request, so we have to use the correlation, where we can decide for ourselves whether we need global variables or local environment variables

Five, run the interface test

Once a single interface has been saved, postman can be executed sequentially and, of course, import and export is supported.

You can also see the results here, 13 verification passes, and the results are also properly

These tools are updated very quickly ah ...

Python API Interface Test

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.