当前位置:网站首页>POSTMAN-REST Client插件的应用
POSTMAN-REST Client插件的应用
2022-06-12 15:15:00 【Stars_min】
POSTMAN-REST Client的概念
+ 是Chrome的一个扩展,可以用来向服务器发送请求和接收响应
REST表示什么
+ Representational State Transfer,REST风格的Web服务,是通过简洁清晰的URL来提供资源链接,客户端通过对URL发送HTTP请求获得这些资源,而获取和处理资源的过程让客户端应用的状态发生改变
请求的方式
| ID | 中文名称 | 英文名称 | 请求资源的方法 |
|---|---|---|---|
| 1 | 增 | Creat | POST |
| 2 | 删 | Delete | DELETE |
| 3 | 改 | Update | PUT |
| 4 | 查 | Read | Get |
举例
- Get请求的实现方式,操作步骤
- 请求资源的方法,这里是Get
- 写入接口地址
- 单击Send按钮

- 发送一个POST请求

- 写入接口地址
- 写入表单数据
- 单机Send按钮

但是,POST请求是需要携带Cookie的。意思就是说,当我们在某个网站执行"发贴"的操作的时候,我们是需要首先登录该网站,才能够被允许执行“发贴”的操作。
所以,我们虽然没有办法在Postman里模拟用户登录,但是我们可以通过携带Cookie的方式来实现"用户是已登录状态"这个场景。来说说操作步骤:
- 单击右上角的Headers按钮
- 此时左侧出现一个表单控件
- 参数写入“Cookie”
- Cookie的值写什么?抓个包吧,登录后随便执行1个操作,然后F12查看Cookie的值,将"Request Headers"下面的Cookie的值都复制下来,然后粘贴到Postman内的Cookie的"Value"这里。

请问,右上角的"URL params"是干什么的呢?
回答:当使用这个按钮操作后,POST请求携带的参数是跟在URL后面的。
请问,POST请求的参数"写在表单内"、"跟在URL后面"这2个方式有什么差别?
回答:差别在于对方如果想要取到参数,前者是从表单内取,后者是从URL取。当然了也可以既从表单内取,同时也从URL取。
资源来源
https://www.cnblogs.com/musicmovie/p/4434052.html
边栏推荐
- The process of generating strong association rules from frequent itemsets
- Common assertions in JUnit testing
- 2021-06-27
- [spark][core] what is an external shuffle service?
- Jetpack architecture component learning (3) -- activity results API usage
- FIRSTVT and LASTVT vernacular
- h3c GR5200路由器上如何设置公网ip可以访问
- Deepin20.6 rtx3080 installing graphics card drivers 510.60.02, cuda11.6, pytorch1.11
- C main函数
- 學習是一件逆人性的事情(成為高手的內功心法)
猜你喜欢

Ngork implements intranet penetration -- free

Left aligned, right aligned, random number, goto, compare output bool

xshell 7 官网免费下载

Autofac Beginner (1)

NETCORE combined with cap event bus to realize distributed transaction -- Introduction (1)

C main function

TF learning notes in ROS

ROS初学者编写小乌龟以一定速度旋转一定角度的server

C 数据类型

Particle filter learning record
随机推荐
PTA:自测-3 数组元素循环右移问题 (20分)
Error 1105: message:\“raft entry is too large
Deepin20.6 RTX3080 安裝顯卡驅動510.60.02、CUDA11.6、PyTorch1.11
Change according to the situation, the road to promotion in the second half of 2022
C constant, cannot be changed
C 转义字符
Autofac (2)
[LDA] rough version notes of EM variational reasoning [to be improved
Mh32f103arpt6 hardware and software compatible alternative to stm32f103rct6
Understanding of Odom coordinate system
[SPARK][CORE] 面试问题之什么是 external shuffle service?
Kinect2.0+ORBSLAM2_ with_ pointcloud_ map
简单的爬虫框架:解析51job页面岗位信息
ROS初学者编写小乌龟以一定速度旋转一定角度的server
Solution to the new database prompt on the pagoda panel that the database name cannot be greater than 16 bits
Conversion between sparse array and array and file reading and writing
学习是一件逆人性的事情(成为高手的内功心法)
Function related matters
USART(RS232422485)、I2C、SPI、CAN、USB总线
【无标题】