首页 技术 正文
技术 2022年11月20日
0 收藏 484 点赞 3,760 浏览 801 个字

1、get 请求

请求接口:http://xx.xx.xx.xx/api/user/stu_info

请求参数:stu_name

请求参数是放在请求 URL 里的,点击 Params添加参数,key 输入参数名stu_name,value 输入参数的值如 test1

2、post请求

请求接口:http://xx.xx.xx.xx/api/user/login

请求参数:usernamepasswd

参数是放在 body 里的,body 里选择 form-data 的数据格式,添加 usernamepasswd参数:

3、入参为 json 格式的 post 请求

请求接口:http://xx.xx.xx.xx/api/user/add_stu

请求参数:json 类型的数据,格式如下:

{
"name":"把啦啦啦",
"grade":"金牛座",
"phone":18564567890,
"sex":"女",
"age": 999,
"addr": "浙江杭州"
}

postman 里切换到 Body 里选择 json 的数据格式,填写参数内容:

4、postman 中添加cookie

请求接口:http://xx.xx.xx.xx/api/user/gold_add

请求参数:需要添加 cookie 才能操作, cookie 中 key 为用户名, value 为用户登录返回的 session。

postman 中 cookie 在 header 里添加,如图:

5、添加 header

请求接口:http://xx.xx.xx.xx/api/user/all_stu

请求参数:带有 header,header 名为Referer, 值为http://api.nnzhp.cn/

6、文件上传

请求接口:http://xx.xx.xx.xx/api/file/file_upload

请求参数:一个文件

postman 里 Body 数据格式选择 form-data,参数类型选择 File,然后就可以进行文件上传的操作了,如图:

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,112
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,585
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,431
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,203
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,838
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,922