asp.net core - Specify expected response on .http files in Visual Studio 2022 - Stack Overflow

admin2025-04-16  5

I have an .http file testing an endpoint for an scenario that returns a 400 after failing to validate the parameters (this is expected). But the test is failing because the response is not 2xx (I guess?).

How can I specify that 400 is the expected response for that test so it doesn’t fail?

### Get a 400 error when trying to get a client by names without the required parameters
GET {{host}}/clients/FindByName
Accept: application/json
apiKey: {{apiKey}}
Tenant: {{tenant}}

转载请注明原文地址:http://www.anycun.com/QandA/1744744845a87006.html