Skip to content

Commit

Permalink
Merge pull request #1 from danielpetrica/feature/get-attachment-body
Browse files Browse the repository at this point in the history
Feature/get attachment body
  • Loading branch information
danielpetrica authored Jul 3, 2024
2 parents 7768ac2 + 79b9901 commit 6d108d3
Show file tree
Hide file tree
Showing 3 changed files with 170 additions and 119 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,16 @@ Forrest::put('/services/data/v20.0/endpoint', ['my'=>'param']);
Forrest::patch('/services/data/v20.0/endpoint', ['my'=>'param']);
Forrest::delete('/services/data/v20.0/endpoint');
```
### Get file body from ContentVersion and Attachment
You can use the Forrest::getContentVersionBody() and Forrest::getAttachmentBody() to retrieve the content of the
uploaded files. They return a streamed response, so it may be a bit cumbersome to use if now used to streams.
Bellow you can find an example to retrieve the content of a uploaded content version.

```php
# example
$data = Forrest::getContentVersionBody($version->Id);
$content = $data->getBody()->getContents();
```

### Raw response output

Expand Down
Loading

0 comments on commit 6d108d3

Please sign in to comment.