Gargoyle
Gargoyle

Reputation: 10375

Restler GET works, but POST returns 404

I have a simple class for Restler (http://luracast.com/products/restler) like so:

class Team extends PostgreSQL {
    function post($name) {
    }

    function players($teamId) {
    }
}

If I run a curl GET, like so: curl http://.../team/players/1

I get back the expected data. If I run a POST, like below, I always get a 404:

curl -X POST http://.../team -H "Content-Type: application/json" -d '{"name": "Team name here"}

I'm not understanding why the POST gives a 404 Not Found.

Upvotes: 0

Views: 272

Answers (1)

Gargoyle
Gargoyle

Reputation: 10375

curl -X POST http://.../team/Team%20Name%20Here

That's how it expects the post to come through.

Upvotes: 0

Related Questions