Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Method not allowed error
Message
 
 
À
20/03/2017 15:23:18
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 5.0
OS:
Windows 10
Database:
MS SQL Server
Divers
Thread ID:
01649202
Message ID:
01649207
Vues:
36
>Your code doesn't show any HttpGet attribute. But if the attribute is present then the method name should be irrelevant (assuming WebApi and attribute routing)
>
>>UPDATE. My colleague helped to solve this problem. For unknown reason the methods need to have Get in front of the method name. Although I also added explicit attribute HTTPGet just in case.
>>

I didn't have that attribute (I thought it's the default). My colleague suggested to add Get in front of the name (and I added the attribute at that same time as well). I think his suggestion was that made it work, but having attribute was probably helpful as well. I can try changing name again to see if that is indeed the case.

UPDATE. I changed the name and indeed it worked. So, as long as I explicitly add an attribute, the name doesn't matter. But the attribute needs to be present.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform