Rest API PUT Request - 404 page not found

Frederick Niekerk asked on July 14, 2020 16:17

Hi. I've been struggling with this issue for a while. Using Kentico12 with MVC application for head. I followed the instructions to enable the REST api, yes even the IIS settings. I am able to use GET requests for existing articles and POST requests for creating new articles. I have not been able to get PUT requests to work for updating existing articles. I've added the below to the web.config of the Kentico 12 application and still get "404 - File or Directory cannot be found". Your help would greatly be appreciated.

        <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
        <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
        <remove name="ExtensionlessUrlHandler-Integrated-4.0" />     

  <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />

  <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />

Recent Answers

Sultan Ahmed answered on July 15, 2020 07:43

Did you check your method, I guess you are not passing id as url part. For example "put /api/employees" will return error, but "put /api/employee/1" must work correctly. .

0 votesVote for this answer Mark as a Correct answer

Frederick Niekerk answered on July 15, 2020 09:17

Yes if it were some other api. That's not how it works according to the documentation ( My alias path is correct because the get method works when retrieving the information.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.