From d2b40d46769ae70f695b677350521182bb68c847 Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Thu, 2 Jun 2022 10:04:14 +0200 Subject: [PATCH] README: Add syntax highlighting to examples --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b945194..d5e6368 100644 --- a/README.md +++ b/README.md @@ -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 = { @@ -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` ``` @@ -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!" - } } } +} ```