Skip to content

Commit 7e82097

Browse files
Added get getContentVersionBody and getAttachmentBody (#347)
* Added get getContentVersionBody and getAttachmentBody Based on code provided in issue #179 * Readme and facade update
1 parent 4a229c9 commit 7e82097

File tree

3 files changed

+170
-119
lines changed

3 files changed

+170
-119
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,16 @@ Forrest::put('/services/data/v20.0/endpoint', ['my'=>'param']);
571571
Forrest::patch('/services/data/v20.0/endpoint', ['my'=>'param']);
572572
Forrest::delete('/services/data/v20.0/endpoint');
573573
```
574+
### Get file body from ContentVersion and Attachment
575+
You can use the Forrest::getContentVersionBody() and Forrest::getAttachmentBody() to retrieve the content of the
576+
uploaded files. They return a streamed response, so it may be a bit cumbersome to use if now used to streams.
577+
Bellow you can find an example to retrieve the content of a uploaded content version.
578+
579+
```php
580+
# example
581+
$data = Forrest::getContentVersionBody($version->Id);
582+
$content = $data->getBody()->getContents();
583+
```
574584

575585
### Raw response output
576586

0 commit comments

Comments
 (0)