Skip to content

Firstvector/SimplePHPCurl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SimplePHPCurl

Simple library for performing cURL requests.

Usage

An example of request with authorization via OAuth or Bearer token.

const CONSUMER_KEY = 'value';
const CONSUMER_SECRET = 'value';
const OAUTH_ACCESS_KEY = 'value';
const OAUTH_ACCESS_SECRET = 'value';

$token = new SimplePHPCurl\OAuthToken(CONSUMER_KEY, CONSUMER_SECRET, OAUTH_ACCESS_KEY, OAUTH_ACCESS_SECRET);
// $token = new SimplePHPCurl\BearerToken('https://api.twitter.com/oauth2/token', CONSUMER_KEY, CONSUMER_SECRET);

$curl = new SimplePHPCurl\Request('https://api.twitter.com/1.1/statuses/user_timeline.json');
$curl->authorization($token);
$curl->get([
    'screen_name' => 'firstvector',
    'count' => 2,
]);
var_dump(
    $curl->execute()
);

An example of simple GET request.

$curl = new SimplePHPCurl\Request('http://firstvector.org');
$curl->get();
var_dump(
    $curl->execute()
);

About

Simple library for performing cURL requests.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages