惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
P
Privacy International News Feed
T
Tenable Blog
L
Lohrmann on Cybersecurity
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Threat Research - Cisco Blogs
S
Securelist
C
CXSECURITY Database RSS Feed - CXSecurity.com
Cisco Talos Blog
Cisco Talos Blog
T
The Exploit Database - CXSecurity.com
S
Schneier on Security
P
Privacy & Cybersecurity Law Blog
Vercel News
Vercel News
Cyberwarzone
Cyberwarzone
月光博客
月光博客
T
The Blog of Author Tim Ferriss
Scott Helme
Scott Helme
爱范儿
爱范儿
Stack Overflow Blog
Stack Overflow Blog
C
Cisco Blogs
aimingoo的专栏
aimingoo的专栏
博客园 - 司徒正美
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
P
Proofpoint News Feed
A
Arctic Wolf
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
L
LangChain Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
阮一峰的网络日志
阮一峰的网络日志
Simon Willison's Weblog
Simon Willison's Weblog
T
Tor Project blog
Security Latest
Security Latest
Blog — PlanetScale
Blog — PlanetScale
G
GRAHAM CLULEY
V
Vulnerabilities – Threatpost
博客园 - 三生石上(FineUI控件)
I
InfoQ
Spread Privacy
Spread Privacy
B
Blog RSS Feed
Microsoft Azure Blog
Microsoft Azure Blog
S
SegmentFault 最新的问题
云风的 BLOG
云风的 BLOG
Last Week in AI
Last Week in AI
MongoDB | Blog
MongoDB | Blog
C
CERT Recently Published Vulnerability Notes
A
About on SuperTechFans
博客园_首页
Engineering at Meta
Engineering at Meta
Project Zero
Project Zero
Latest news
Latest news

博客园 - 陈惟鲜的博客

win11安装mysql8 AI软件修改脚本与代码,还真不敢完全操作 linux 磁盘满了,排查 Ecelipse 安装 MAT linux 增加新磁盘 redis自身查询很慢 排查redis-benchmark prometheus监控mysql数据库 prometheus监控springboot项目配置 监控工具prometheus配置-docker版 linux 文件属性被替换修改查询并修改 ----i----------- ZonedDateTime 转为 java.util.Date docker 容器查看jvm参数配置 redis 事务处理,一旦异常,则回滚 linux 下安装使用jmeter 执行压测 大批量订单来了由于入库慢,先缓存后通知入库 eclipse 合并错分支代码还原,合并到本分支但未push到库上 mysql 查询jason格式数据 maven打包慢,使用maven-mvnd 打包可以快一半 postman 参数化构建 批量测试 使用AOP实现+自定义注解 实现 缓存 如何判断redis慢了
postman 常用参数例子
陈惟鲜的博客 · 2023-06-02 · via 博客园 - 陈惟鲜的博客
文档路径:https://learning.postman.com/docs/getting-started/navigating-postman/

常用tests用法如下:

1.检查response body中是否包含某个string tests["Body matches string"] = responseBody.has("string_you_want_to_search"); 注意:"Body matches string" 需唯一。 2.检测JSON中的某个值是否等于预期的值 var data = JSON.parse(responseBody); tests["Your test name"] = data.value === 100; JSON.parse()方法,把json字符串转化为对象。parse()会进行json格式的检查是一个安全的函数。 如:检查json中某个数组元素的个数(这里检测programs的长度) var data = JSON.parse(responseBody); tests["program's lenght"] = data.programs.length === 5; 3.检查response body是否与某个string相等 4.转换XML body为JSON对象 var jsonObject = xml2Json(responseBody); tests["Body is correct"] = responseBody === "response_body_string"; 5.测试response Headers中的某个元素是否存在(如:Content-Type) tests["Content-Type is present"] = postman.getResponseHeader("Content-Type"); //getResponseHeader()方法会返回header的值,如果该值存在 或者: tests["Content-Type is present"] = responseHeaders.hasOwnProperty("Content-Type"); 上面的方法,不区分大小写。下面的方法,要区分大小写。 6.验证Status code的值 tests["Status code is 200"] = responseCode.code === 200; 7.验证Response time是否小于某个值 tests["Response time is less than 200ms"] = responseTime < 200; 8.name是否包含某个值 tests["Status code name has string"] = responseCode.name.has("Created"); 9.POST 请求的状态响应码是否是某个值 tests["Successful POST request"] = responseCode.code === 201 || responseCode.code === 202; 10.很小的JSON数据验证器 var schema = { "items": { "type": "boolean" } }; var data1 = [true, false]; var data2 = [true, 123]; console.log(tv4.error); tests["Valid Data1"] = tv4.validate(data1, schema); tests["Valid Data2"] = tv4.validate(data2, schema);

posted on 2023-06-02 20:07  陈惟鲜的博客  阅读(110)  评论()    收藏  举报