Created
October 17, 2019 22:01
-
-
Save porfidev/854c8c993b67302f847592548efa91e4 to your computer and use it in GitHub Desktop.
Peticiones HTTP get sin Curl
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 | |
include('vendor/rmccue/requests/library/Requests.php'); | |
Requests::register_autoloader(); | |
$url = 'https://jsonplaceholder.typicode.com/posts'; | |
$response = Requests::get($url); | |
## $response->body es el resultado de la petición | |
echo(json_encode($response)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment