Merge pull request #22 from scottmotte/master

More detailed install instructions in README. ...
This commit is contained in:
Marco Palladino
2013-11-01 19:10:51 -07:00

View File

@@ -4,39 +4,35 @@ Unirest is a set of lightweight HTTP libraries available in multiple languages.
Created with love by http://mashape.com
### Installing
Unirest-PHP requires PHP `v5.3+`. Download the PHP library from Github, and require in your script like so:
```php
require_once './lib/Unirest.php';
```
### Using Composer
[Composer](http://getcomposer.org/) is a package manager for PHP.
In the composer.json file in your project add:
### Install with Composer
If you're using [Composer](https://github.com/composer/composer) to manage
dependencies, you can add Unirest with it.
```javascript
{
"require" : {
"mashape/unirest-php" : "dev-master"
},
"autoload": {
"psr-0": {"Unirest": "lib/"}
}
}
```
And then run:
```
php composer.phar install
### Install source from GitHub
Unirest-PHP requires PHP `v5.3+`. Download the PHP library from Github, and require in your script like so:
To install the source code:
```bash
$ git clone git@github.com:Mashape/unirest-php.git
```
Include the library in your project with:
And include it in your scripts:
```php
require 'vendor/autoload.php';
````
```bash
require_once '/path/to/unirest-php/lib/Unirest.php';
```
## Creating Request
So you're probably wondering how using Unirest makes creating requests in PHP easier, let's look at a working example: