<commit_before>PHP REST Client
===============
https://github.com/tcdent/php-restclient  
(c) 2013-2016 <NAME> <<EMAIL>>  

Installation
-----------
``` sh
$ php composer.phar require tcdent/php-restclient
```


Basic Usage
-----------
``` php
$api = new RestClient([
    'base_url' => "https://api.twitter.com/1.1", 
    'format' => "json", 
     // https://dev.twitter.com/docs/auth/application-only-auth
    'headers' => ['Authorization' => 'Bearer '.OAUTH_BEARER], 
]);
$result = $api->get("search/tweets", ['q' => "#php"]);
// GET http://api.twitter.com/1.1/search/tweets.json?q=%23php
if($result->info->http_code == 200)
    var_dump($result->decode_response());
```


Configurable Options
--------------------
`headers` - An associative array of HTTP headers and values to be included in every request.  
`parameters` - An associative array of parameters to be merged with individual request parameters in every request.  
`curl_options` - cURL options to apply to every request. These will override any automatically generated values.  
`user_agent` - User agent string.  
`base_url` - URL to use for the base of each request.  
`format` - Format to append to resource and support decoding.  
`format_regex` - Pattern to extract format from response Content-Type header.  
`decoders` - Associative array of format decoders, see documentation below.  
`username` - Username to use for basic authentication. Requires `password`.  
`password` - Password to use for basic authentication. Requires `username`.  

Options can be set upon instantiation, or individually afterword:

``` php
$api = new RestClient([
    'format' => "json", 
    'user_agent' => "my-application/0.1"
]);
```
-or-

``` php
$api = new RestClient;
$api->set_option('format', "json");
$api->set_option('user_agent', "my-application/0.1");
```

<commit_msg>Clarify docs.<commit_after>PHP REST Client
===============
https://github.com/tcdent/php-restclient  
(c) 2013-2016 <NAME> <<EMAIL>>  

Installation
-----------
``` sh
$ php composer.phar require tcdent/php-restclient
```


Basic Usage
-----------
``` php
$api = new RestClient([
    'base_url' => "https://api.twitter.com/1.1", 
    'format' => "json", 
     // https://dev.twitter.com/docs/auth/application-only-auth
    'headers' => ['Authorization' => 'Bearer '.OAUTH_BEARER], 
]);
$result = $api->get("search/tweets", ['q' => "#php"]);
// GET http://api.twitter.com/1.1/search/tweets.json?q=%23php
if($result->info->http_code == 200)
    var_dump($result->decode_response());
```


Configurable Options
--------------------
`headers` - An associative array of HTTP headers and values to be included in every request.  
`parameters` - An associative array of URL or body parameters to be included in every request.  
`curl_options` - cURL options to apply to every request; anything defined here: https://secure.php.net/manual/en/function.curl-setopt.php. These will override any automatically generated values.  
`user_agent` - User agent string to use in requests.  
`base_url` - URL to use for the base of each request.  
`format` - Format string is appended to resource on request (extension), and used to determine which decoder to use on response; a request URL like "api.twitter.com/1.1/statuses/user_timeline.json" would be expected to return well-formed JSON.  
`format_regex` - Pattern to extract format from response Content-Type header, used to determine which decoder to use on response.  
`decoders` - Associative array of format decoders. See ["Direct Iteration and Response Decoding"](#direct-iteration-and-response-decoding).  
`username` - Username to use for HTTP basic authentication. Requires `password`.  
`password` - Password to use for HTTP basic authentication. Requires `username`.  

Options can be set upon instantiation, or individually afterword:

``` php
$api = new RestClient([
    'format' => "json", 
    'user_agent' => "my-application/0.1"
]);
```
-or-

``` php
$api = new RestClient;
$api->set_option('format', "json");
$api->set_option('user_agent', "my-application/0.1");
```


{'fraction_non_alphanumeric': 0.16526887025160336, 'fraction_numerical': 0.010853478046373951, 'mean_word_length': 3.7041763341067284, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 35, 'https://': 7, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1595944', 'n_tokens_mistral': 1285, 'n_tokens_neox': 1205, 'n_words': 387}