性能测试时,有一个登录接口, 登录成功后,会返回一个登录凭证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库,获取到响应头,直接解析出来即可;这样能快速获取到大量


1867

被折叠的 条评论
为什么被折叠?



