当前位置:网站首页>postman学习
postman学习
2022-06-22 17:13:00 【码起来呗】
文章目录
前言
提示:https://www.bilibili.com/video/BV1434y1h7vf?spm_id_from=333.1007.top_right_bar_window_history.content.click&vd_source=33acb67196498979ff3eb7ff24fccf9a进入链接
提示:以下是本篇文章正文内容,下面案例可供参考
一、Git请求
Git请求一般没有请求体,只关注请求方式和请求地址就可以了。
测试API网站:
https://api.apiopen.top/swagger/index.html
二、接口测试流程
1、获取接口信息:接口文档或者抓包
抓包使用F12。切换到network,最好选Fetch/xhr。
视频提供的抓包测试网站:
testingedu.com.cn:8000/Home/user/login.html

需要的接口信息:
接口在向服务器传递过程中,产生报文,报文的格式:行+头+体,分为请求报文(request)和返回报文(response)。
2.1.1 请求报文的构成
行 + 头 + 体:
请求报文分为四大要素:
请求行: HTTP方法和URL地址。
请求头: 一般不怎么关注。唯一默认要关注的是content-type请求格式类型。
请求体:get一般没有请求体,不用管,post put方法,参数一般会放在请求体里面。
请求体的格式eg:
类型一:Content-Type: text/html; charset=utf-8
我的理解,这像一个快递的打包类型,如果我拿一个冰棒让快递员邮寄,他会拿一个冷冻的盒子来装,如果我拿一本书,他会拿一个普通的盒子来装。Content-Type相当于是包装类型。
类型二:Content-Type:application/json
2.1.2 返回报文的构成
一般只关注请求体和状态码。
常见的状态码:
| 类别 | 原因短语 | |
|---|---|---|
| 1XX | Informational(信息性状态码) | 接受的请求正在处理 |
| 2XX | Success(成功状态码) | 请求正常处理完毕 |
| 3XX | Redirection(重定向状态码) | 需要进行附加操作以完成请求 |
| 4XX | Client Error(客户端错误状态码) | 服务器无法处理请求 |
| 5XX | Server Error(服务器错误状态码) | 服务器处理请求出错 |
原文链接:https://blog.csdn.net/qq_35689573/article/details/82120851
2、编辑请求报文(抄),完成请求,过程中根据自己的测试用例设计修改参数。
3、验证返回结果
postman中编写预期结果的校验,所谓的断言。
在tests/测试中写断言脚本。
总结
postman使用很简单。
边栏推荐
- [win11] right click fix to modify the registry but not create a new one
- Conda——基础配置命令总结
- [OWT] OWT client native P2P E2E test vs2017 build
- 缺失值處理
- Gridhome, a must-have static site generator for beginners
- Jenkins configuration project integration pin notification
- [applet project development -- Jingdong Mall] configuration tabbar & window style for uni app development
- sqlserver保存时遇到这个页面怎么回事啊
- Nuxt - create nuxt app
- RSPS2022 Finalist | Dr. Yang Bai 简介
猜你喜欢

TypeScript(7)泛型

Grafana 9 正式发布,更易用,更酷炫了!

Typescript (7) generic

JSP learning (I) -- overview of JSP

Nuxt - Universal(SSR / SSG)/ Single Page App(渲染模式)

SystemVerilog(十二)-$unit声明空间

零基础学编程/学逆向/过检测(frida实战)
![azkaban启动报错 2022/06/20 21:39:27.726 +0800 ERROR [StdOutErrRedirect] [Azkaban] Exception in thread “m](/img/02/2e402f05022b36dc48ff47232e8535.png)
azkaban启动报错 2022/06/20 21:39:27.726 +0800 ERROR [StdOutErrRedirect] [Azkaban] Exception in thread “m

Killed by the script, and "resurrected" by camping
Concepts and solutions of redis' cache penetration, cache avalanche and cache breakdown problems
随机推荐
JSP learning (I) -- overview of JSP
jsp连接MySQL总出错
Oculus学习笔记之控制器输入初步(一)
Binary tree practice the second bullet
sqlserver保存时遇到这个页面怎么回事啊
东华大学|具有强化知识感知推理的可解释推荐微观行为研究
Killed by the script, and "resurrected" by camping
传统图像--LBP特征
Jenkins配置项目集成钉钉通知
Azkaban startup error 2022/06/20 21:39:27.726 +0800 error [stdouterrredirect] [azkaban] exception in thread "m
如何持续突破性能表现? | DX研发模式
When do project managers particularly want to escape from work?
The Fourth Youth Life Science Forum | first round notice
Cloud minimalist deployment svelte3 chat room
网络智能运维助力运维效率提升
< JVM part I: memory and garbage collection part > 08 object instantiation and direct memory
math_角函数&反三角函数
让RDS(for MySQL)数据库的慢日志、审计日志跨空间转存OBS变得更加自动化
中国移动手机用户缓慢增长,但努力争取高利润的5G套餐用户
2022年5月中国游戏厂商及应用出海 EMEA 地区收入30强