Skip to content

mz026/php_restler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Restler for PHP

Installation:

clone and include restler.php file would introduce a class Restler under global namespace.

Usage:

$result = Restler::request(array(
  'url' => 'http://google.com'
  , 'method' => 'GET' (optional, default to 'GET')
  , 'headers' => array('key' => 'val') (optional)
  , 'body' => <string> | <array> (optional)
  , 'files' => array(
    'fileKey' => '/path/to/file'
  ) (optional)
));

$status = $result['status'];
$response = $result['response'];

$body = $response -> get_body();
$responseHeaders = $response -> get_headers();

Test

restler uses PHPSpec to test. To run the test: 1 . first, cd to test directory.

$ cd /path/to/test

2 . second,

$ ./phpspec-composer spec/DescribeRestler.php -c

About

curl tool for php

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages