Postman sends request to send JSON data method

First, we open Postman
and select Collections.
insert image description here
Click the plus sign above to pull out a project
insert image description here
, then right-click on the project and select Add request to create a request.
insert image description here
Then we need to enter our own request address. Here mine is http://localhost:8080/user/getName
Then I chose post for the previous request type,
and then for the parameter passing method below
Body,
we choose the parameter type next to
raw , we choose json, and then enter our own json format in the text field below.

insert image description here

{
    
    
    "键": "值",
    "name": "测试数据"
}

insert image description here
Maybe most people, like me, don’t know that keys need to be enclosed in double quotes, which leads to difficulties

Guess you like

Origin blog.csdn.net/weixin_45966674/article/details/130474350