Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function fork_http_method(array $methods)
- {
- return function() use ($methods)
- {
- $what = $_SERVER['REQUEST_METHOD'];
- if (!array_key_exists($what, $methods))
- api_error('This method is not implemented.', 501);
- $methods[$what]();
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement