Skip to content

Commit

Permalink
Moved documentation (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyholm authored Jul 19, 2016
1 parent d8c6e00 commit cd04192
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,9 @@ Via Composer
$ composer require php-http/multipart-stream-builder
```

## Usage

```php
$builder = new MultipartStreamBuilder();
$builder
->addResource('foo', $stream)
->addResource('bar', fopen($filePath, 'r'), ['filename' => 'bar.png'])
->addResource('baz', 'string', ['headers' => ['Content-Type' => 'text/plain']]);

$multipartStream = $builder->build();
$boundary = $builder->getBoundary();

$request = MessageFactoryDiscovery::find()->createRequest(
'POST',
'http://example.com',
['Content-Type' => 'multipart/form-data; boundary='.$boundary],
$multipartStream
);
$response = HttpClientDiscovery::find()->sendRequest($request);
```

## Documentation

Please see the [official documentation](http://php-http.readthedocs.org/en/latest/multipart-stream-builder/).
Please see the [official documentation](http://php-http.readthedocs.org/en/latest/components/multipart-stream-builder.html).


## Contributing
Expand Down

0 comments on commit cd04192

Please sign in to comment.