Jmeter即使在http请求中设置了参数accountnumber

发布于 2025-02-03 03:09:56 字数 1700 浏览 3 评论 0 原文

这是我发现的非常条件的问题。我正在尝试发送Jemeter的请求。它不断说我的badrequest和帐户名没有设定。但是我是从Jemeter的参数设置的。 我从邮递员那里运行了同样的请求,但它正在工作,但无法从Jmeter起作用。

Connection: keep-alive
Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6Ik9FWUZrWVJmUU0zX2tLamEzTGJ0Q0EiLCJ0eXAiOiJhdCtqd3QifQ.eyJuYmYiOjE2NTM4MDQ5OTcsImV4cCI6MTY1MzgwODU5NywiaXNzIjoiaHR0cHM6Ly9hcHAtaW5mLWlkcy10cy1xYS5henVyZXdlYnNpdGVzLm5ldCIsImF1ZCI6ImRvYy1nZW4iLCJjbGllbnRfaWQiOiJkb2MtZ2VuIiwiY2xpZW50X1NoYXJlZFNlY3JldCI6ImNzZ0MwcWNWZkIvLzlJZ1NpUTE5RUdRUlYrRURwNWZ6QzIyaHRMWmdYSVU9Iiwic2NvcGUiOlsiZG9jLWdlbiJdfQ.cFtbTYmUKRa-8jlm9uLlsax-9lylOEvpdO9WxDN-eXpBlQtryLjrtaZvxGTM2kMRLwSd97jZIth0v6PnuQivEiEenvg0nYI02rfCDmNVNgvIzeplsBrD410MaeyGNYHfdWT_ZgfhWdhgosf7b-8h22Br6ySfojd8hUaTt5njgoYf7x5hBrylgE8URN_D9SUpQY7r9v1Pftwx4S6E5cKa8Uc5kt4hQdaXvJnu0WixLBcAL38HqDaIIZwP-r9dHJ_j0sSWs7baPm_9ekK4NI_BByx1wY8jzeSbnmtIEyCAkVXtVQ4SCYd7DqejZnsM0hJ62_keAoOpFzfbnwBo6BqNfg
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate, br
Content-Length: 25
Host: app-test.azurewebsites.net
User-Agent: Apache-HttpClient/4.5.12 (Java/11.0.11)

“

”

This is very strage issue that I found. I am trying to send a request from the jemeter. it keeps saying me the badrequest and accountNumber is not set. But I am setting it from the Paramters from Jemeter.
Same request I am running from the Postman and it is working but not working from the Jmeter.

enter image description here

enter image description here

Any help will be greatly appriciated

Request header

Connection: keep-alive
Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6Ik9FWUZrWVJmUU0zX2tLamEzTGJ0Q0EiLCJ0eXAiOiJhdCtqd3QifQ.eyJuYmYiOjE2NTM4MDQ5OTcsImV4cCI6MTY1MzgwODU5NywiaXNzIjoiaHR0cHM6Ly9hcHAtaW5mLWlkcy10cy1xYS5henVyZXdlYnNpdGVzLm5ldCIsImF1ZCI6ImRvYy1nZW4iLCJjbGllbnRfaWQiOiJkb2MtZ2VuIiwiY2xpZW50X1NoYXJlZFNlY3JldCI6ImNzZ0MwcWNWZkIvLzlJZ1NpUTE5RUdRUlYrRURwNWZ6QzIyaHRMWmdYSVU9Iiwic2NvcGUiOlsiZG9jLWdlbiJdfQ.cFtbTYmUKRa-8jlm9uLlsax-9lylOEvpdO9WxDN-eXpBlQtryLjrtaZvxGTM2kMRLwSd97jZIth0v6PnuQivEiEenvg0nYI02rfCDmNVNgvIzeplsBrD410MaeyGNYHfdWT_ZgfhWdhgosf7b-8h22Br6ySfojd8hUaTt5njgoYf7x5hBrylgE8URN_D9SUpQY7r9v1Pftwx4S6E5cKa8Uc5kt4hQdaXvJnu0WixLBcAL38HqDaIIZwP-r9dHJ_j0sSWs7baPm_9ekK4NI_BByx1wY8jzeSbnmtIEyCAkVXtVQ4SCYd7DqejZnsM0hJ62_keAoOpFzfbnwBo6BqNfg
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate, br
Content-Length: 25
Host: app-test.azurewebsites.net
User-Agent: Apache-HttpClient/4.5.12 (Java/11.0.11)

enter image description here

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

最舍不得你 2025-02-10 03:09:56

您可以通过这种方式进行操作,

将http请求采样器的路径更改为 并添加标头管理器提供以下详细信息,

“在这里输入图像描述”

”在此处输入图像说明”

U can do it by this way,

Change the path of the http request sampler to /api/vi/Documents/Requests/Initialize?accountNumber=88925982303 and add a header manager with below details,

enter image description here

enter image description here

那请放手 2025-02-10 03:09:56

如果您能够使用Postman成功运行请求,则只需使用Jmeter的

  1. 启动jmeter的


  2. import jmeter jmeter的Mitm证书

    “在此处输入图像描述”

  3. i.sstatic.net/roedw.png“ rel =“ nofollow noreferrer ” p> 配置Postman将Jmeter用作代理

  4. 在Postman中运行您的请求

  5. jmeter中运行您的请求,将生成相关的 http heater

更多信息:如何将邮递员API测试转换为jmeter以进行缩放

特别是您需要的情况。在URL中传递 accountnumber ,而不是在请求主体中。

If you're able to successfully run your request using Postman you can just record it using JMeter's HTTP(S) Test Script Recorder

  1. Start JMeter's HTTP(S) Test Script Recorder

  2. Import JMeter's MITM certificate to Postman

    enter image description here

  3. Configure Postman to use JMeter as the proxy
    enter image description here

  4. Run your request in Postman

  5. JMeter will generate the relevant HTTP Request sampler and the HTTP Header Manager

More information: How to Convert Your Postman API Tests to JMeter for Scaling

In particular your case you need to pass the accountNumber in URL, not in the request body.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文