<commit_before># PHP cURL [![Build Status](https://travis-ci.org/sylouuu/php-curl.svg)](https://travis-ci.org/sylouuu/php-curl) [![GitHub version](https://badge.fury.io/gh/sylouuu%2Fphp-curl.svg)](http://badge.fury.io/gh/sylouuu%2Fphp-curl)

## Requirements

* PHP >= 5.4
* [cURL](http://php.net/manual/fr/book.curl.php/) library enabled

## Install

### Composer

```js
{
    "require": {
        "sylouuu/php-curl": "0.6.*"
    }
}
```

```php
require_once './vendor/autoload.php';
```

## Usage

```php
// Namespace shortcut
use sylouuu\Curl as Curl;

// Template
$request = new Curl\Method( string $url [, array $options ] );
```

Methods are: `Get`, `Head`, `Options`, `Post`, `Put`, `Patch` and `Delete`.

Basic case:

```php
// Create a request
$request = new \sylouuu\Curl\Get('http://domain.com');

// Send this request
$request->send();

// Show the response
echo $request->getResponse();
```

### Constructor options

```php
[
    'data' => [                    // Data to send, available for `Post` `Put` and `Patch`
        'foo' => 'bar'
    ],
    'headers' => [                 // Additional headers (optional)
        'Authorization: foobar'
    ],
    'ssl' => '/cacert.pem',        // Use it for SSL (optional)
    'autoclose' => true            // Is the request must be automatically closed (optional)
]
```

### Public methods

```php
// Send a request
$request->send();

// HTTP status code
$request->getStatus();

// HTTP header
$request->getHeader();

// HTTP body response
$request->getResponse();
<commit_msg>readme: removed duplicate example<commit_after># PHP cURL [![Build Status](https://travis-ci.org/sylouuu/php-curl.svg)](https://travis-ci.org/sylouuu/php-curl) [![GitHub version](https://badge.fury.io/gh/sylouuu%2Fphp-curl.svg)](http://badge.fury.io/gh/sylouuu%2Fphp-curl)

## Requirements

* PHP >= 5.4
* [cURL](http://php.net/manual/fr/book.curl.php/) library enabled

## Install

### Composer

```js
{
    "require": {
        "sylouuu/php-curl": "0.6.*"
    }
}
```

```php
require_once './vendor/autoload.php';
```

## Usage

```php
// Namespace shortcut
use sylouuu\Curl as Curl;

// Template
$request = new Curl\Method( string $url [, array $options ] );
```

Methods are: `Get`, `Head`, `Options`, `Post`, `Put`, `Patch` and `Delete`.

### Constructor options

```php
[
    'data' => [                    // Data to send, available for `Post` `Put` and `Patch`
        'foo' => 'bar'
    ],
    'headers' => [                 // Additional headers (optional)
        'Authorization: foobar'
    ],
    'ssl' => '/cacert.pem',        // Use it for SSL (optional)
    'autoclose' => true            // Is the request must be automatically closed (optional)
]
```

### Public methods

```php
// Send a request
$request->send();

// HTTP status code
$request->getStatus();

// HTTP header
$request->getHeader();

// HTTP body response
$request->getResponse();

{'fraction_non_alphanumeric': 0.2013793103448276, 'fraction_numerical': 0.004137931034482759, 'mean_word_length': 2.904441453566622, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 25, 'https://': 6, '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': '1579086', 'n_tokens_mistral': 1066, 'n_tokens_neox': 1017, 'n_words': 229}