Welcome Guest, Not a member yet? Register   Sign In
How to send DELETE request using phil sturgeon - codeigniter-restserver
#1

[eluser]fatman[/eluser]
Hi,

I'm testing the codeigniter-restserver framework using FF addon called 'HTTP Resource test', which allows me to send any kind of request.

It all works fine when I use GET,PUT,POST but when I use DELETE I'm unable to get the id.

my code:

Code:
<?php
require(APPPATH.'libraries/REST_Controller.php');

class Client extends REST_Controller{

function user_get()
{
  $data = array('returned:'=> $this->get('id'));
  $this->response($data);
}

function user_post()
{
  $data = array('returned:'=> $this->get('id'));
  $this->response($data);
}

function user_put()
{
  $data = array('returned:'=> $this->get('id'));
  $this->response($data);
}

function user_delete()
{
  $data = array('returned:'=> $this->get('id'));
  $this->response($data);
}
}

and i'm trying to call this URL: http://localhost/client/user/id/1
as a DELETE method. but '$this->get('id')' returns an empty string.
#2

[eluser]fatman[/eluser]
Got the answer from Phil, you can see it here: http://stackoverflow.com/questions/10997...restserver




Theme © iAndrew 2016 - Forum software by © MyBB