Last active
June 28, 2025 05:18
-
-
Save Shakil-Shahadat/f52e12a8d5c26c0437857a5a45576f87 to your computer and use it in GitHub Desktop.
✓ GET Request by Fetch
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 | |
header( 'Access-Control-Allow-Origin: *' ); | |
echo 'Hello World!'; | |
// Ref: https://www.php.net/manual/en/reserved.variables.post.php#125651 |
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
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