Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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