Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Sean Dooley 288 posts 527 karma points
    Jun 20, 2011 @ 17:18
    Sean Dooley
    0

    Error message: 405 Method Not Allowed

    Any ideas how to resolve error message '405 Method Not Allowed'?

    Below is the script I am using to call the token method

    <script type="text/javascript">
            $(document).ready(function () {
                $.ajax({
                    contentType: 'application/json; charset=utf-8',
                    type: 'GET',
                    url: 'rest/token?Username=admin&Password=XXX&Type=User',
                    data: "",
                    dataType: 'json',
                    success: function (msg) {
                    }
                });
            });
        </script>

    Thanks

  • Matt Brailsford 4123 posts 22194 karma points MVP 9x c-trib
    Jun 20, 2011 @ 17:23
    Matt Brailsford
    0

    Hi Sean,

    Please check the documentation for the Token service:

    http://urest4umb.codeplex.com/wikipage?title=Token&referringTitle=Documentation

    Your main problem is that you are using a get request, when a Token request must be done via POST. Also, the request data, must be sent in JSON format, in the body of the POST request.

    Details on the JSON format, and the required request formats are all on codeplex.

    Many thanks

    Matt

  • Sean Dooley 288 posts 527 karma points
    Jun 20, 2011 @ 17:31
    Sean Dooley
    0

    Hi Matt

    Thanks for the response - have got it working now.

  • Matt Brailsford 4123 posts 22194 karma points MVP 9x c-trib
    Jun 20, 2011 @ 17:34
    Matt Brailsford
    0

    Hey Sean,

    Sweet. 

    I think I definatley need to put a small demo project together for people, as your post is one of a couple where people are struggling to start. I'll add it to my list, and see if I can't get something out on my blog in the near future.

    Cheers

    Matt

  • Daniel 9 posts 29 karma points
    Feb 01, 2013 @ 13:58
    Daniel
    0

    I am getting this message also for a POST request.

    This is my request (sent using jMeter):

     

    POST http://umbraco47.local/rest/documents?auth_username=username&auth_token=dfe24320457754b8fbf207614ee1f5abde462359

     

    POST data:

    {

    "Name":"ProductName",

    "DocTypeAlias":"document-alias"

    }

     

    [no cookies]

     

    Request Headers:

    Connection: keep-alive

    Content-type: application/json

    Accept: application/json

    Content-Length: 72

    Host: umbraco47.local

    User-Agent: Apache-HttpClient/4.2.3 (java 1.5)

     

     

    Response:

    IIS 7.5 Detailed Error - 405.0 - Method Not Allowed

    Server Error in Application "UMBRACO47"

    Internet Information Services 7.5

    Error Summary

    HTTP Error 405.0 - Method Not Allowed

    The page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used.

    Detailed Error Information
    Module ManagedPipelineHandler
    Notification ExecuteRequestHandler
    Handler OpenRastaHandler
    Error Code 0x00000000
    Requested URL http://umbraco47.local:80/rest/documents?auth_username=dafeza&auth_token=dfe24320457754b8fbf207614ee1f5abde462359
    Physical Path C:\Users\dafeza\Dropbox\Projects\umbraco47\rest\documents
    Logon Method Anonymous
    Logon User Anonymous
    Most likely causes:
    • The request sent to the Web server used an HTTP verb that is not allowed by the module configured to handle the request.
    • A request was sent to the server that contained an invalid HTTP verb.
    • The request is for static content and contains an HTTP verb other than GET or HEAD.
    • A request was sent to a virtual directory using the HTTP verb POST and the default document is a static file that does not support HTTP verbs other than GET or HEAD.
    Things you can try:
    • Verify the list of verbs enabled for the module handler this request was sent to, and ensure that this verb should be allowed for the Web site.
    • Check the IIS log file to see which verb is not allowed for the request.
    • Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click here.
    Links and More InformationThis error means that the request sent to the Web server contained an HTTP verb that is not allowed by the configured module handler for the request.

    View more information ยป

     

Please Sign in or register to post replies

Write your reply to:

Draft