简体   繁体   English

如何从get api获取csrf令牌并使用REST Assured将csrf令牌传递给另一个post api?

[英]How to get csrf token from get api and pass csrf token to another post api using REST Assured?

How to get csrf token from get api and pass csrf token to another post api? 如何从get api获取csrf令牌并将csrf令牌传递给另一个post api?

I have to perform login. 我必须登录。 For this I have to pass 3 parameters: 为此,我必须传递3个参数:

  1. csrftoken csrftoken
  2. username 用户名
  3. password 密码

The csrftoken is received using GET https://url.com/account/login in form of response body in DOC format. 使用GET https://url.com/account/login以DOC格式的响应正文形式接收csrftoken。

Request is : 要求是:

在此输入图像描述

Response is : 回应是: 在此输入图像描述

Response Header is : 响应标头是:

在此输入图像描述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用REST方法和REST方法获取REST API终结点的访问令牌,当前出现404错误? - How to get the access token of REST API endpoint using Rest Assured with POST method, Currently I am getting 404 error? 如何在登录时获取 csrf 令牌? - How to get csrf token on login in? 如何使用 Rest Assured 从 KeyCloak 服务获取承载令牌 - How to get Bearer Token from KeyCloak Service using Rest Assured CSRF令牌验证失败,如何修复使用宁静的放心框架? - CSRF token validation failed, How to fix using serenity rest assured framework? 如何在 java REST 客户端中获取有效的 X-CSRF-TOKEN? - how to get valid X-CSRF-TOKEN in java REST Client? 如何使用 Rest Assured 在 API 请求中添加 Bearer 令牌 - How to add Bearer token in API rerquest using Rest Assured 如何使用Rest-Assured请求POST API发送令牌和主体值? - How to request a POST API send token and body values using Rest-Assured? 如何使用REST确保自动获取Bearer令牌 - How to automatically get Bearer Token using REST Assured 如何将访问令牌值从一个 API 响应主体(在一个类中)提取到另一个 API 标头(在另一个类中)在 rest 保证代码中 - How to extract accesss token value from one API response body(in one class) into another API header(in another class) in rest assured code 如何在get请求中将keycloak生成的令牌传递给rest api? - How to pass the keycloak generated token in get request to rest api?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM