jmeter 提取响应头中的set-Cookie

性能测试时,有一个登录接口, 登录成功后,会返回一个登录凭证token。但这个token不是在响应应答里面返回而是在响应头里面会返回一个set-cookie,如下:

HTTP/1.1 200 OK
Server: hsiar
Date: Fri, 30 Oct 2020 03:24:14 GMT
Content-Type: application/json;charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: token=6e204d9b-103a-431e-b8de-ba97b2d1; path=/; HttpOnly
Access-Control-Allow-Origin: 192.168.xx.xxx
Access-Control-Allow-Methods: GET,POST
Access-Control-Allow-Headers: x-msg-timeout,X-Msg-Trace,csrfcheck,ShardingInfo,Partition,broker_key,X-Original-URI,X-Request-Method,Authorization,access_token,login_account,auth_password,user_type,tenant_id,auth_code,Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With
Allow: POST,GET,OPTIONS
Access-Control-Allow-Credentials: true
Access-Control-Expose-Headers: x-msg-timeout,X-Msg-Trace,csrfcheck,ShardingInfo,Partition,Date,Server

一看, 这个也很easy,通过python+requests库,获取到响应头,直接解析出来即可;这样能快速获取到大量

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值