I have a [HttpDelete]
action in my Web API, and when I invoke it with a long URL, I get 400.
I know for sure it's the URL length since I managed to fail / pass the request by adding and removing a single character.
I had a similar issue with [HttpGet]
request length which I had resolved by adding configurations to my web.config:
Under system.web
:
<httpRuntime maxRequestLength="1048576" maxQueryStringLength="32768" maxUrlLength="65536" waitChangeNotification="2147483647" maxWaitChangeNotification="2147483647" requestPathInvalidCharacters="" targetFramework="4.5" />
Under system.webServer
:
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="1073741824" maxQueryString="32768" maxUrl="65536"/>
</requestFiltering>
</security>
But the issue seems to be reproducing in the Delete
action as well, and I'm failing to come with a solution. I'm not getting anything in IIS trace and IIS logs as well.
How to fix this?