Learning summary--using postman to do HTTP interface testing

Source: Internet
Author: User

Postman do various types of HTTP interface tests

First, there must be a clear interface document (e.g. http://test.nnzhp.cn/wiki/index.php?doc-view-59) before doing the interface test, assuming that the postman has been installed on the PC.

1. Common get requests with Key-value

e.g. getting user information

Get requests, write URLs to spell parameters, send requests, view results.

2. Post requests with JSON string parameters

e.g. getting user balances

Post request, write URL, click Body->raw, write json string parameter, send request

Back to Authorization View results

3. HTTP permission validation is required for the request

e.g. modifying user balances

Post request, write URL and parameters, type Select Basic Auth, fill in User name and password (if required interface document will be given), send request

4. Request headers need to be added when requesting

e.g. obtaining user Information 2

Get request, write URL and parameters, click Headers and add header (if required in the interface document will be given), send request, view results

5. Need to add a cookie when requesting

e.g. modifying user balances 2

Post requests, write URLs and parameters, open plug-in interceptor (if prompted to install in an external environment, install once and for all), write a cookie in headers, the value is filled in by the interface documentation, send the request, view the results.

6. Request to upload a file via an interface

e.g. uploading files

Post request, write URL, modify text in body to file, fill in Parameter name, select Local file, send request, view results

Postman Management Requests

We can create collection in postman (according to the project, according to the function module, etc.) and then save multiple requests in the collection, so that simple management can be achieved. In addition we can do some simple operation of collection, such as collection export to local backup, batch run collection in the request, and so on, the speed of the batch run seems very slow ah, this may be no one with Postman do batch interface test reason, Try to look at it boldly, and there will be more gains.

Learning summary--using postman to do HTTP interface testing

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.