Skip to content

Commit 923ad77

Browse files
committed
Installation instructions and usage example
1 parent 83add54 commit 923ad77

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

Diff for: README.md

+31-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# API Client PSR-7 Oauth1
1+
# PSR-7 Oauth1 request signer
22

33
[![Build Status](https://travis-ci.org/php-api-clients/psr7-oauth1.svg?branch=master)](https://travis-ci.org/php-api-clients/psr7-oauth1)
44
[![Latest Stable Version](https://poser.pugx.org/api-clients/psr7-oauth1/v/stable.png)](https://packagist.org/packages/api-clients/psr7-oauth1)
@@ -7,6 +7,36 @@
77
[![License](https://poser.pugx.org/api-clients/psr7-oauth1/license.png)](https://packagist.org/packages/api-clients/psr7-oauth1)
88
[![PHP 7 ready](http://php7ready.timesplinter.ch/php-api-clients/psr7-oauth1/badge.svg)](https://appveyor-ci.org/php-api-clients/psr7-oauth1)
99

10+
# Installation
11+
12+
To install via [Composer](http://getcomposer.org/), use the command below, it will automatically detect the latest version and bind it with `^`.
13+
14+
```bash
15+
composer require api-clients/psr7-oauth1
16+
```
17+
18+
# Example
19+
20+
```php
21+
<?php
22+
23+
$requestSigner = new RequestSigner(
24+
new ConsumerKey('consumer_key'),
25+
new ConsumerSecret('consumer_secret')
26+
);
27+
28+
// Returns a signed PSR7 request you can use in any PSR7 capable HTTP client
29+
$request = $requestSigner->withAccessToken(
30+
new AccessToken('token_key'),
31+
new TokenSecret('token_secret')
32+
)->sign($request);
33+
```
34+
35+
36+
# Contributing
37+
38+
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
39+
1040
# License
1141

1242
The MIT License (MIT)

0 commit comments

Comments
 (0)