postman—- pass parameter format (json format, form format)

Time:2024-5-14

 

This article mainly explains the use of postman post request method in two ways to pass parameters: json format, form format

First of all, understand that postman for interface testing, the must condition is:

request address

request agreement

request method

request header

parameters

json format

Look at the interface documentation and fill in the necessary parameters in the postman according to the interface documentation

postman---- pass parameter format (json format, form format)

post request method, using json format to pass parameters, in the request headers (headers) header information, add data format: content-Type, value is application/json, the

In the request body body, write in raw mode, write the parameter information in json format

postman---- pass parameter format (json format, form format)

postman---- pass parameter format (json format, form format)

Complete the above information and click [send] to send the request request.

In the response message, select the json format to view the result

Format — urlencoded pass parameter

postman---- pass parameter format (json format, form format)

Interface address: http://test.lemonban.com/ningmengban/mvc/user/login.json

Request method: post

post request format: application/x-www-form-urlencoded———–> means that the form format to pass parameters

username:13916686542

password:b5523f18a092325c5d19f0809c262563

The form passes the parameters, which are set in params.

postman---- pass parameter format (json format, form format)

Or configure it as follows

postman---- pass parameter format (json format, form format)

Then set the data format in headers and click send,to get the response result.

postman---- pass parameter format (json format, form format)

Recommended Today

ImportError: cannot import name ‘Literal‘ from ‘typing‘ (D:\Anaconda\envs\tensorflow\lib\typing.py)

Reporting Errors Background: I downgraded python 3.8 to 3.7 in my original newly created anaconda environment (mine is named tensorflow) because the tensorflow-gpu version needs to be installed. The following error occurs when importing the seaborn package: ImportError: cannot import name ‘Literal’ from ‘typing’ (D:\Anaconda\envs\tensorflow\lib\typing.py) Cause analysis: This is due to the fact that ‘Literal’ […]