Last active
March 23, 2025 11:40
-
-
Save Shakil-Shahadat/f52e12a8d5c26c0437857a5a45576f87 to your computer and use it in GitHub Desktop.
✓ GET Request by Fetch
This file contains 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 | |
header( 'Access-Control-Allow-Origin: *' ); | |
$received = file_get_contents( 'php://input' ); | |
echo $received; | |
// Ref: https://www.php.net/manual/en/reserved.variables.post.php#125651 |
This file contains 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
fetch( 'get.php' ) | |
.then( response => response.text() ) | |
.then( data => console.log( data ) ) | |
.catch( error => console.error( 'Error:', error ) ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment