More detailed install instructions in README. Also make composer the priority install.
This commit is contained in:
38
README.md
38
README.md
@@ -4,39 +4,35 @@ Unirest is a set of lightweight HTTP libraries available in multiple languages.
|
|||||||
|
|
||||||
Created with love by http://mashape.com
|
Created with love by http://mashape.com
|
||||||
|
|
||||||
|
### Install with Composer
|
||||||
|
If you're using [Composer](https://github.com/composer/composer) to manage
|
||||||
### Installing
|
dependencies, you can add Unirest with it.
|
||||||
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:
|
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
{
|
{
|
||||||
"require" : {
|
"require" : {
|
||||||
"mashape/unirest-php" : "dev-master"
|
"mashape/unirest-php" : "dev-master"
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-0": {"Unirest": "lib/"}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
And then run:
|
|
||||||
|
|
||||||
```
|
### Install source from GitHub
|
||||||
php composer.phar install
|
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
|
```bash
|
||||||
require 'vendor/autoload.php';
|
require_once '/path/to/unirest-php/lib/Unirest.php';
|
||||||
````
|
```
|
||||||
|
|
||||||
## Creating Request
|
## Creating Request
|
||||||
So you're probably wondering how using Unirest makes creating requests in PHP easier, let's look at a working example:
|
So you're probably wondering how using Unirest makes creating requests in PHP easier, let's look at a working example:
|
||||||
|
|||||||
Reference in New Issue
Block a user