Today I stumbled upon a documentation bug in MSDN (once more). When trying to access the list of all available WebTemplates on a web, this article describes that you can use SharePoint’s REST interface by sending an HttpPost request to http://yourtenant.sharepoint.com/sites/yoursite/_api/web/getAvailableWebTemplates(1033). I was wondering why should I call a ‘get’ method using HttpPost verb.
So I gave it a try. Using Chrome’s Postman plugin (which is awesome for experimenting with REST interfaces) I tried to call the method as described within the MSDN reference. SharePoint’s response was not surprising. When actually executing such an request you might receive an error like this
In order to get this working, you just have to change the HttpVerb from POST to GET and SharePoint will return the suggested data.
I’ve also submitted the documentation bug to MSFT, perhaps the correct HttpVerb will appear on MSDN soon . That’s all for now, let’s get back to work… I’ve to finish my SPApp.