File tree Expand file tree Collapse file tree 1 file changed +1
-22
lines changed Expand file tree Collapse file tree 1 file changed +1
-22
lines changed Original file line number Diff line number Diff line change @@ -15,30 +15,9 @@ Via Composer
1515$ composer require php-http/multipart-stream-builder
1616```
1717
18- ## Usage
19-
20- ``` php
21- $builder = new MultipartStreamBuilder();
22- $builder
23- ->addResource('foo', $stream)
24- ->addResource('bar', fopen($filePath, 'r'), ['filename' => 'bar.png'])
25- ->addResource('baz', 'string', ['headers' => ['Content-Type' => 'text/plain']]);
26-
27- $multipartStream = $builder->build();
28- $boundary = $builder->getBoundary();
29-
30- $request = MessageFactoryDiscovery::find()->createRequest(
31- 'POST',
32- 'http://example.com',
33- ['Content-Type' => 'multipart/form-data; boundary='.$boundary],
34- $multipartStream
35- );
36- $response = HttpClientDiscovery::find()->sendRequest($request);
37- ```
38-
3918## Documentation
4019
41- Please see the [ official documentation] ( http://php-http.readthedocs.org/en/latest/multipart-stream-builder/ ) .
20+ Please see the [ official documentation] ( http://php-http.readthedocs.org/en/latest/components/ multipart-stream-builder.html ) .
4221
4322
4423## Contributing
You can’t perform that action at this time.
0 commit comments