POST Method Not Allowed

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

POST Method Not Allowed

geemang
Hey Guys,

Not sure why I'm getting a "Method Not Allowed" when trying to post to my login method. Ideas?

curl -X POST -H "Content-Type: application/json" -d '{"username":"xyz","password":"xyz"}' http://localhost:5050/login 
returns....
    <div id="messages">
    <h1>Method Not Allowed</h1>
    <table class="meta">
        <tr> <th>Request Method:</th> <td>POST</td> </tr>
        <tr> <th>Request URL:</th> <td>/login</td> </tr>
    </table>
    </div>
ratpack.groovy
post("login") {
        println "login1"
        def builder = new groovy.json.JsonBuilder()
        builder.call(
            [result:'true', uid:'asdf', cn:'asdf']
        )
        println 'user->json:'+builder.toString()
        response.send "application/json", builder.toString()
}
Reply | Threaded
Open this post in threaded view
|

Re: POST Method Not Allowed

Luke Daley
Administrator
How are you starting the app? Is that your complete ratpack.groovy?