{"action":"created","issue":{"url":"https://api.github.com/repos/klein/klein.php/issues/203","repository_url":"https://api.github.com/repos/klein/klein.php","labels_url":"https://api.github.com/repos/klein/klein.php/issues/203/labels{/name}","comments_url":"https://api.github.com/repos/klein/klein.php/issues/203/comments","events_url":"https://api.github.com/repos/klein/klein.php/issues/203/events","html_url":"https://github.com/klein/klein.php/issues/203","id":31673931,"number":203,"title":"Unable to retrieve parameters from PUT method","user":{"login":"matthewgovaere","id":1873698,"avatar_url":"https://avatars.githubusercontent.com/u/1873698?v=3","gravatar_id":"","url":"https://api.github.com/users/matthewgovaere","html_url":"https://github.com/matthewgovaere","followers_url":"https://api.github.com/users/matthewgovaere/followers","following_url":"https://api.github.com/users/matthewgovaere/following{/other_user}","gists_url":"https://api.github.com/users/matthewgovaere/gists{/gist_id}","starred_url":"https://api.github.com/users/matthewgovaere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthewgovaere/subscriptions","organizations_url":"https://api.github.com/users/matthewgovaere/orgs","repos_url":"https://api.github.com/users/matthewgovaere/repos","events_url":"https://api.github.com/users/matthewgovaere/events{/privacy}","received_events_url":"https://api.github.com/users/matthewgovaere/received_events","type":"User","site_admin":false},"labels":[{"id":33657251,"url":"https://api.github.com/repos/klein/klein.php/labels/Feature","name":"Feature","color":"02e10c","default":false},{"id":50853486,"url":"https://api.github.com/repos/klein/klein.php/labels/May%20Not%20Implement","name":"May Not Implement","color":"cccccc","default":false}],"state":"open","locked":false,"assignee":{"login":"Rican7","id":742384,"avatar_url":"https://avatars.githubusercontent.com/u/742384?v=3","gravatar_id":"","url":"https://api.github.com/users/Rican7","html_url":"https://github.com/Rican7","followers_url":"https://api.github.com/users/Rican7/followers","following_url":"https://api.github.com/users/Rican7/following{/other_user}","gists_url":"https://api.github.com/users/Rican7/gists{/gist_id}","starred_url":"https://api.github.com/users/Rican7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rican7/subscriptions","organizations_url":"https://api.github.com/users/Rican7/orgs","repos_url":"https://api.github.com/users/Rican7/repos","events_url":"https://api.github.com/users/Rican7/events{/privacy}","received_events_url":"https://api.github.com/users/Rican7/received_events","type":"User","site_admin":false},"assignees":[{"login":"Rican7","id":742384,"avatar_url":"https://avatars.githubusercontent.com/u/742384?v=3","gravatar_id":"","url":"https://api.github.com/users/Rican7","html_url":"https://github.com/Rican7","followers_url":"https://api.github.com/users/Rican7/followers","following_url":"https://api.github.com/users/Rican7/following{/other_user}","gists_url":"https://api.github.com/users/Rican7/gists{/gist_id}","starred_url":"https://api.github.com/users/Rican7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rican7/subscriptions","organizations_url":"https://api.github.com/users/Rican7/orgs","repos_url":"https://api.github.com/users/Rican7/repos","events_url":"https://api.github.com/users/Rican7/events{/privacy}","received_events_url":"https://api.github.com/users/Rican7/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2014-04-16T19:55:51Z","updated_at":"2016-10-29T22:02:39Z","closed_at":null,"body":"Unable to retrieve parameters from the method 'PUT' using `$request->params()`. I'm assuming that the 'DELETE' method has the same issue.\n\nAm I missing something? If not, I may be able to help add it in.\n"},"comment":{"url":"https://api.github.com/repos/klein/klein.php/issues/comments/257118631","html_url":"https://github.com/klein/klein.php/issues/203#issuecomment-257118631","issue_url":"https://api.github.com/repos/klein/klein.php/issues/203","id":257118631,"user":{"login":"funkytaco","id":1712205,"avatar_url":"https://avatars.githubusercontent.com/u/1712205?v=3","gravatar_id":"","url":"https://api.github.com/users/funkytaco","html_url":"https://github.com/funkytaco","followers_url":"https://api.github.com/users/funkytaco/followers","following_url":"https://api.github.com/users/funkytaco/following{/other_user}","gists_url":"https://api.github.com/users/funkytaco/gists{/gist_id}","starred_url":"https://api.github.com/users/funkytaco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/funkytaco/subscriptions","organizations_url":"https://api.github.com/users/funkytaco/orgs","repos_url":"https://api.github.com/users/funkytaco/repos","events_url":"https://api.github.com/users/funkytaco/events{/privacy}","received_events_url":"https://api.github.com/users/funkytaco/received_events","type":"User","site_admin":false},"created_at":"2016-10-29T22:02:38Z","updated_at":"2016-10-29T22:02:38Z","body":"I put this code (found via SO) in my base controller class.\r\n\r\n    public function http_put_data(\\stdClass &$a_data) {\r\n              $input = file_get_contents('php://input');\r\n              preg_match('/boundary=(.*)$/', $_SERVER['CONTENT_TYPE'], $matches);\r\n              $boundary = $matches[1];\r\n              $a_blocks = preg_split(\"/-+$boundary/\", $input);\r\n              array_pop($a_blocks);\r\n              foreach ($a_blocks as $id => $block) {\r\n                if (empty($block))\r\n                  continue;\r\n                if (strpos($block, 'application/octet-stream') !== FALSE) {\r\n                  preg_match(\"/name=\\\"([^\\\"]*)\\\".*stream[\\n|\\r]+([^\\n\\r].*)?$/s\", $block, $matches);\r\n                }\r\n                else {\r\n                  preg_match('/name=\\\"([^\\\"]*)\\\"[\\n|\\r]+([^\\n\\r].*)?\\r$/s', $block, $matches);\r\n                }\r\n                $a_data->{$matches[1]} = $matches[2];\r\n              }\r\n            }\r\n\r\nThen you access the data like so.\r\n\r\n    $put_data = (object)[];\r\n    $this->http_put_data($put_data);\r\n    echo $put_data->someVar;\r\n\r\n\r\nThe only change I made to the code above was to use an $a_data object instead of array, as I like object syntax better for this to match Klein's style.\r\n\r\nThis probably doesn't handle every data type you can PUT. It works perfectly fine for form-data.\r\n"}}
{"actor":{"display_login":"funkytaco"}}