lib/ringcentral_sdk/helpers/fax.rb in ringcentral_sdk-0.5.0 vs lib/ringcentral_sdk/helpers/fax.rb in ringcentral_sdk-0.5.1
- old
+ new
@@ -26,14 +26,17 @@
end
end
end
def add_metadata(meta=nil)
+ base64_encode = true
meta = inflate_metadata(meta)
json = MultiJson.encode(meta)
+ json = Base64.encode64(json) if base64_encode
json_part = MIME::Text.new(json)
json_part.headers.delete('Content-Id')
- json_part.headers.set('Content-Type','application/json')
+ json_part.headers.set('Content-Type', 'application/json')
+ json_part.headers.set('Content-Transfer-Encoding', 'base64') if base64_encode
@msg.add(json_part)
return true
end
def inflate_metadata(meta=nil)
\ No newline at end of file