Skip to content

Commit

Permalink
README: Add syntax highlighting to examples
Browse files Browse the repository at this point in the history
  • Loading branch information
olleolleolle authored and ioquatix committed Jun 2, 2022
1 parent 78c2696 commit 746e1a4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,15 @@ File.open("./image.jpg") do |file|
end
end
```

### Parts Headers
By default, all individual parts will include the header `Content-Disposition` as well as `Content-Length`, `Content-Transfer-Encoding` and `Content-Type` for the File Parts.

You may optionally configure the headers `Content-Type` and `Content-ID` for both ParamPart and FilePart by passing in a `parts` header.

For example:
```

```ruby
url = URI.parse('http://www.example.com/upload')

params = {
Expand All @@ -115,6 +117,7 @@ headers = {

req = Net::HTTP::Post::Multipart.new(uri, params, headers)
```

This would configure the `file_metadata_01` part to include `Content-Type`

```
Expand All @@ -129,15 +132,16 @@ Content-Type: application/json
*For FileParts only.*

You can include any number of custom parts headers in addition to `Content-Type` and `Content-ID`.
```

```ruby
headers = {
'parts': {
'file_metadata_01': {
'Content-Type' => "application/json",
'My-Custom-Header' => "Yo Yo!"
}
}
}
}
```


Expand Down

0 comments on commit 746e1a4

Please sign in to comment.