• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
POST method in REST architecture returning a 404

#1
[eluser]Unknown[/eluser]
Hi all,
I've been using CI for a while but this is the first time I'm implementing REST.

GET, PUT, etc are all fine and work great. However when I use POST in the same routing settings, i get a 404 error.

I'm using CI version 1.7.

Here's my routing:
$route['service/test/file'] = "some_controller/createFile";

Controller:
class some_controller extends rest_controller {
public function createFile()
{
//--do something here
}
}

Again, using GET or PUT method is fine. I can get it to return whatever I want and all works. But using POST, even with nothing in the createFile function, i get a 404.

Had a snoop around CI code, I notice that the problem is somewhere in the router.php file. It looks like either _set_routing() and/or _parse_routes() is called twice, the first time being the correct route "some_controller/createFile" and the second time is something weird like "in/index.php".

Any ideas?

#2
[eluser]Unknown[/eluser]
I also tried with another REST test application and it's returning the same result.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.