Hi, Created some POST and PUT methods those are working properly on local environment but that is not working when we deployed on production GET methods are working properly, but while PUT and POST getting 405 (Method Not Allowed) error
also getting , No 'Access-Control-Allow-Origin' after above error even CorsOrigins is configured properly in appsetting.json
Please help!
Thank you! Prashant
4 Answer(s)
-
0
-
0
So the PUT and POST methods are not implemented correctly. I guess you are talking about your Application Services... If so you can use HTTP method attributes on your interface methods.
public interface ITaskAppService : IApplicationService { [HttpGet] GetTasksOutput GetTasks(GetTasksInput input); [HttpPut] void UpdateTask(UpdateTaskInput input); [HttpPost] void CreateTask(CreateTaskInput input); }
<a class="postlink" href="https://aspnetboilerplate.com/Pages/Documents/Dynamic-Web-API#http-attributes">https://aspnetboilerplate.com/Pages/Doc ... attributes</a>
-
0
Able to resolved this issue by adding following lines in web.config
<modules runAllManagedModulesForAllRequests="true"> <remove name="WebDAVModule"/> </modules>
Thank you All! Prashant
-
0
thanks for your feedback. ;)