这是我发现的一个非常严重的问题。我试图从Jemeter发送一个请求。它一直说我badrequest和accountNumber没有设置。但是我从Jemeter的参数设置它。我从 Postman 运行同样的请求,它正在工作,但从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)
2条答案
按热度按时间yduiuuwa1#
你可以这样做,
将
path of the http request sampler
更改为/api/vi/Documents/Requests/Initialize?accountNumber=88925982303
,并添加一个标题管理器,详细信息如下,v1l68za42#
如果您能够使用Postman成功运行请求,则可以使用JMeter的HTTP(S) Test Script Recorder记录它
1.启动JMeter的HTTP(S)测试脚本记录器
1.在Postman中运行您的请求
更多信息:How to Convert Your Postman API Tests to JMeter for Scaling
特别是在您的情况下,您需要在URL中传递
accountNumber
,而不是在请求正文中。