Welcome Guest, Not a member yet? Register   Sign In
Discovering HTTP verb in Controller
#1

[eluser]Lister[/eluser]
Me again :-)

I understand that URI's map to methods in a controller, but how do you determine what HTTP verb was used to invoke the method?

I plan to implement a RESTful type service, so I'll need to do different things depending on GET, POST, DELETE etc.

Cheers,
Lister
#2

[eluser]Phil Sturgeon[/eluser]
You might be interested in my post on a REST implementation I put together for CodeIgniter.

Even if you don't use the whole thing you can pick through the code and use certain bits.

Specifically, the answer to the question is:

Code:
$this->input->server('REQUEST_METHOD'));
#3

[eluser]Lister[/eluser]
Many thanks. Haven't had a chance to look over your code yet but at a brief glance it looks like you've put a lot of thought into it so I'll definitely be having a look at your conclusions. Big Grin




Theme © iAndrew 2016 - Forum software by © MyBB