Skip to content

Commit 8c1ac7e

Browse files
committed
changed readme to explain use of DELETE
1 parent def1295 commit 8c1ac7e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,21 @@ This allows you to implement a RESTful interface easily:
3535

3636
`REST_Controller` also supports `PUT` and `DELETE` methods, allowing you to support a truly RESTful interface.
3737

38+
3839
Accessing parameters is also easy. Simply use the name of the HTTP verb as a method:
3940

4041
$this->get('blah'); // GET param
4142
$this->post('blah'); // POST param
4243
$this->put('blah'); // PUT param
43-
$this->delete('blah'); // DELETE param
44+
45+
The HTTP spec for DELETE requests precludes the use of parameters. For delete requests, you can add items to the URL
46+
47+
public function index_delete($id)
48+
{
49+
$this->response(array(
50+
'returned from delete:' => $id,
51+
));
52+
}
4453

4554
## Content Types
4655

0 commit comments

Comments
 (0)