Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-6493

HTML Error 405 'method not allowed error' using XWiki RESTful HTTP Method PUT

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • Major
    • None
    • 2.5
    • REST, Tag
    • Windows XP Professional, MySQL database, XWiki 2.4, XWiki REST resources

    Description

      The error is an HTML Error '405' method not allwed using the PUT services to update a page or add a tag to a page for the RESTful API:

      Page 'PUT'
      http://platform.xwiki.org/xwiki/bin/view/Features/XWikiRESTfulAPI#HPageresources

      Tag 'PUT'
      http://platform.xwiki.org/xwiki/bin/view/Features/XWikiRESTfulAPI#HTagresources

      I created a javascript extension and added a function to update a page with a word,

      updatePage = function(cont)
      {
        var encodeTag = encodeURIComponent(tag);
      
      //  var params = new Hash({'tag' : encodeTag, '});
      var updatePageURl = XWiki.contextPath + '/rest/wikis/' + encodeURIComponent(XWiki.currentWiki) + '/spaces/' + encodeURIComponent(XWiki.currentSpace) + '/pages/' + encodeURIComponent(XWiki.currentPage)+'?media=text/plain&postBody='+cont;
        
           new Ajax.Request(updatePageURL, {method: 'PUT'});
        }
      
      
      
      addTag = function(tag)
      {
        var encodeTag = encodeURIComponent(tag);
      
      //  var params = new Hash({'tag' : encodeTag, '});
      var addTagURL = XWiki.contextPath + '/rest/wikis/' + encodeURIComponent(XWiki.currentWiki) + '/spaces/' + encodeURIComponent(XWiki.currentSpace) + '/pages/' + encodeURIComponent(XWiki.currentPage)+'/tags?media=text/plain&postBody='tag;
        
           new Ajax.Request(addTagURL, {method: 'PUT'});
        }
      

      Attachments

        Activity

          People

            tmortagne Thomas Mortagne
            mvida Michelle Vida
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: