HTTP PUT If Failed in IIS 8.5

It seems like it is getting deeper in IIS than I'm good! So I have a web API controller that works great for GET and POST. The first screen shot shows GET processing. Everything was wonderful, I get an answer.

View full size Success detail

But then I make a PUT request and it all falls apart. It seems that it travels through the ManagedPipelineHandler and then fails in the DefaultDocumentModule module and does not work with 405.

View full size Fail summary

View full size Fail details

There is no WebDAV installed, and I tried to remove it anyway at the web.config level. Handlers are redefined to support PUT.

<handlers>
  <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
  <remove name="OPTIONSVerbHandler" />
  <remove name="TRACEVerbHandler" />
  <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" />
</handlers>

Despite this, the request is not processed by ASP.NET, and am I looking for some ideas for debugging? Here is an action method that fails, PUT and one that works, GET.

public class ProductsController : ApiController
{
    [HttpPut]
    [Route("api/products")]
    public AddProductResponse AddProduct(AddProductRequest request)
    {
        return new AddProductResponse(); 
    }

    [HttpGet]
    [Route("api/products/manufacturers")]
    public ManufacturersResponse GetProductManufacturers()
    {
        var productService = new ProductService();
        var manufacturers = productService.GetManufacturers();
        return new ManufacturersResponse { Manufacturers = manufacturers.OrderBy(m => m.BusinessName) };
    }
}

, .

FREB, , GENERAL_SHILD_REQUEST_START PUT, , , DefaultDocumentModule, PUT.

+4
2

( ), , webapi /api .

, /api/products, , /api/products http put, IIS PUT .

. api , API REST. , - , IIS .

( )

<modules runAllManagedModulesForAllRequests="true" />

ASP.NET IIS, , .

+1

. PHP REST Api 404 PUT DELETE IIS 8.5. , Fast CGI- .

, web.config:

<system.webServer>
    <handlers>
        <remove name="PHP55_via_FastCGI" />
        <add name="PHP55_via_FastCGI" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\PHP\v5.5\php-cgi.exe" resourceType="Either" requireAccess="Script" />
    </handlers>
    ...

PHP, , - .

0

Source: https://habr.com/ru/post/1527646/


All Articles