我已经通过Fiddler创建了一个WebTest,该WebTest使用基本的Authorization方法将其发布到公共端点。该调用在Fiddler / Postman中工作正常,但是当我将以下Web测试作为Azure的可用性测试上载时,它失败了,给我411错误。
<?xml version="1.0" encoding="utf-8"?>
<TestCase Name="FiddlerGeneratedWebTest" Id="" Owner="" Description="" Priority="0" Enabled="True" CssProjectStructure="" CssIteration="" DeploymentItemsEditable="" CredentialUserName="" CredentialPassword="" PreAuthenticate="True" Proxy="" RequestCallbackClass="" TestCaseCallbackClass="">
<Items>
<Request Method="POST" Version="1.1" Url="https://myapp.scm.azurewebsites.net/api/triggeredwebjobs/mywebjob/run" ThinkTime="0" Timeout="60" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8">
<Headers>
<Header Name="Authorization" Value="Basic JGRldi1sb2NhbGl0eS13ZWItam9iphYVJSN1o0QjlmUXBNZlhjcXJKSHd1RFpYNW1xWlE4MTNzRnRMMUpOc2JFNXVna3l2aWVhQ3pBNXJvYzg=" />
<Header Name="Content-Length" Value="0" />
</Headers>
<QueryStringParameters>
<QueryStringParameter Name="arguments" Value="health" UrlEncode="True" UseToGroupResults="False" />
</QueryStringParameters>
</Request>
</Items>
</TestCase>
可用性测试失败后返回:
> 1 primary requests, 0 dependant requests and 0 conditional rules failed
> Http Error (subtype '411 - LengthRequired') occured at 09/06/2018
> 05:49:45 (UTC) for Uri
> 'https://myapp.scm.azurewebsites.net/api/triggeredwebjobs/mywebjob/run?arguments=health',
> step #1 with the error '411 - LengthRequired'.
任何帮助将不胜感激!