0

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.

Gargoyle
  • 9,590
  • 16
  • 80
  • 145
  • I don't see the whole URLs here, but the one with post seems to end with just "/team", meaning it doesn't include the function name... – Nathan H Dec 31 '13 at 07:49
  • Shouldn't it automatically call the post method via Restler's routing? – Gargoyle Dec 31 '13 at 07:51
  • Maybe I'm not familiar enough with Restler. It's just that your GET points to /team/players/1 and your POST to /team . I assumed you wanted to make the same request... I would first try to make a POST to /team/post – Nathan H Dec 31 '13 at 08:07

1 Answers1

0

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

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

Gargoyle
  • 9,590
  • 16
  • 80
  • 145