我想POST HTTP请求,并请求不会通。我在做什么错误或丢失?
我认为它不喜欢这部分colonoscopy.jpg / 1-1?
Server name: ${hostName}
Path: ${virtualDirectory}/data/media/${location}/colonoscopy.jpg/1-1?&prodName=${prodName}&otherParams=&sid=${authToken}
HTTP Header Manager
Content-Type application/x-www-form-urlencoded
入门
Thread Name: Thread Group 1-1
Sample Start: 2019-02-01 15:39:06 PST
Load time: 0
Connect Time: 0
Latency: 0
Size in bytes: 1681
Sent bytes:0
Headers size in bytes: 0
Body size in bytes: 1681
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""): text
Response code: Non HTTP response code: java.net.URISyntaxException
Response message: Non HTTP response message: Illegal character in path at index 53: http://10.188.169.185/api/v2/data/media/dc2e83cfe2054
Server:%20Microsoft-IIS/10.0
Set-Cookie:%20ASP.NET_SessionId=5cwq0inclxwvmd0qlnd01yo3;%20path=/;%20HttpOnly
X-AspNet-Version:%204.0.30319
X-Powered-By:%20ASP.NET
Access-Control-Allow-Origin:%20*
Access-Control-Allow-Headers:%20Content-Type,Authorization
Access-Control-Expose-Headers:%20Content-Location,%20Location
Access-Control-Allow-Methods:%20GET,%20POST,%20OPTIONS,%20DELETE
Date:%20Fri,%2001%20Feb%202019%2023:39:05%20GMT
Content-Length:%200
colonoscopy.jpg/1-1?&prodName=test&otherParams=&sid=ca1bc7a576a44d9b8270b7cac2dddab8
HTTPSampleResult fields:
ContentType:
DataEncoding: null
检查您的网址使用query string监听器View Results Tree以来,误差只能有一个理由:你发送需要URL encoding,因为它是一个字符。
其原因是:
${location}
,${prodName}
或${authToken}
)有需要的URL编码的字符。如果是这样的话 - 你需要将它包装成__urlencode() function${location}
,${prodName}
或${authToken}
)的是没有得到解决入值和大括号字符({
和}
)未经编码的URL字符串是不允许的。使用Debug Sampler确保:
所有的变量具有其值
所有的characters which require the encoding使用__urlencode()
功能编码