-
-
Save tristanbailey/c11018e748f908e05111 to your computer and use it in GitHub Desktop.
Return a response to the client before processing anything
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 | |
// Return our response as quickly as possible. | |
header('Connection: close'); | |
ob_start(); | |
header('HTTP/1.0 200 OK'); | |
ob_end_flush(); | |
flush(); | |
// This immediately sends our response to the client; I hope you didn't have any other headers to set. | |
// Now, you can do all your other processing. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sample code to send a response as a api endpoint and then follow with a request in return in later code