File tree 1 file changed +1
-22
lines changed
1 file changed +1
-22
lines changed Original file line number Diff line number Diff line change @@ -15,30 +15,9 @@ Via Composer
15
15
$ composer require php-http/multipart-stream-builder
16
16
```
17
17
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
-
39
18
## Documentation
40
19
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 ) .
42
21
43
22
44
23
## Contributing
You can’t perform that action at this time.
0 commit comments