curl myapi.com/company --> 404
curl myapi.com/company/ ---> 200

fuck it. I give up.

  • 2
    You could edit your .htaccess to strip trailing slashes.

    Otherwise, I'm pretty sure that symfony's router has a config to do it.
  • 6
    That's "proper" REST behavior. /company/ should return all companies.
  • 1
    @spongessuck ah, I have always wondered what is app with that.

  • 4
    @spongessuck shouldn't /companies return all companies, and /company/1 return the company with ID 1?
  • 4
    @Rocket3G no. It has to be the same resource, and I believe the convention is to use plural. In this case /companies/ returns everything and /companies/{id} returns a single company. There is a github repo about this called WhiteHouse API or something similar
Add Comment