rest - Codeigniter PUT request -
i try make put request can't. form.
<form method="put" action="http://localhost/index.php/book"> <input type="text" name="bookname" /> <input type="submit" value="send"/> </form> my controller
<?php require(apppath.'libraries/rest_controller.php'); class book extends rest_controller { function index_put(){ echo $this->put('bookname'); } } ?> the problem not show anything.
the html standard does not support put inside <form method=""> attribute, if put else other post or get should sent get request according spec.
the canonical workaround implemented many framewrok include hidden _method field in form , put actual http verb there. seems using this library, , _method parameter workaround too.
Comments
Post a Comment