Skip to content

Instantly share code, notes, and snippets.

View mosampaio's full-sized avatar

Marcos Sampaio mosampaio

  • Sydney, Australia
View GitHub Profile
@mosampaio
mosampaio / app.php
Last active August 24, 2016 17:26
How to consume a json Rest API with PHP using Httpful
<?php
require __DIR__ . '/vendor/autoload.php';
$url = "https://api.github.com/repos/twilio/twilio-php/contributors";
$response = \Httpful\Request::get($url)->expectsJson()->send();
print_r($response->body);
@mosampaio
mosampaio / app.php
Last active August 18, 2019 20:08
How to consume a json Rest API with PHP using Guzzle
<?php
require __DIR__ . '/vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client([
'base_uri' => 'https://api.github.com',
'timeout' => 5.0,
]);
@mosampaio
mosampaio / app.php
Last active August 24, 2016 17:26
How to consume a json Rest API with PHP using Unirest
<?php
require __DIR__ . '/vendor/autoload.php';
$response = Unirest\Request::get('https://api.github.com/repos/twilio/twilio-php/contributors');
print_r($response->body);
@mosampaio
mosampaio / README.md
Last active September 1, 2016 14:21
Gmail Api OAuth Using Node.js Express - part 1

How to Run?

  • Make sure there is a mongodb instance running locally.

  • First export the environment variables.

export CLIENT_ID=your-client-id
export CLIENT_SECRET=your-client-secret
export DOMAIN_URL=your-domain-url
@mosampaio
mosampaio / README.md
Last active January 13, 2021 08:02
Gmail Api OAuth Using Node.js Express - part 2

How to Run?

  • Make sure there is a mongodb instance running locally.

  • First export the environment variables.

export CLIENT_ID=your-client-id
export CLIENT_SECRET=your-client-secret
export DOMAIN_URL=your-domain-url