Created
January 16, 2014 16:00
-
-
Save Potherca/8457454 to your computer and use it in GitHub Desktop.
Simple Silex implementation to return a 418 HTTP Response. For testing purposes, obviously.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $app = new MySilexApplication(); | |
| $app->match('/api/coffee/', | |
| function() use ($app){ | |
| $statusCode = 418; | |
| $response = array('status' => 'ok', 'code' => $statusCode, 'message' => 'The HTCPCP Server is a teapot. The responding entity MAY be short and stout.'); | |
| return $app->json((object) $response, $statusCode); | |
| } | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment