Skip to content

Instantly share code, notes, and snippets.

@porfidev
Created October 17, 2019 22:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save porfidev/854c8c993b67302f847592548efa91e4 to your computer and use it in GitHub Desktop.
Save porfidev/854c8c993b67302f847592548efa91e4 to your computer and use it in GitHub Desktop.
Peticiones HTTP get sin Curl
<?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