Created
February 1, 2013 02:43
-
-
Save anthonycvella/4688771 to your computer and use it in GitHub Desktop.
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
// Send HTTP Response Method | |
function sendResponse($status, $body = '') | |
{ | |
$status_header = 'HTTP/1.1 ' . $status; | |
header($status_header); | |
header('Content-type: application/json'); | |
echo $body; | |
} | |
// Calling the HTTP Response Method with parameters | |
sendResponse(200, json_encode(array( | |
'username' => $username, | |
'token' => $token | |
))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment