我如何从请求 Jmeter 获取属性

How I can get attribute from request Jmeter

我需要从请求属性中的会话中获取一个 csrfToken,然后放入 POST 请求中,我该怎么做?

根据 Spring documentation you will find the token in the response in form of HTML hidden input 看起来像:

<input type="hidden" name="${A}" value="${_csrf.token}"/>

这样您就可以使用 CSS Selector Extractor to get the token value and store it into a JMeter Variable 这样您以后就可以 re-use 在需要的地方使用它。

更多信息:How to Load Test CSRF-Protected Web Sites