File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
templates/ruby/lib/container Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -213,7 +213,7 @@ module {{ spec.title | caseUcfirst }}
213
213
when 'application/json'
214
214
payload = params.to_json
215
215
when 'multipart/form-data'
216
- payload = "--#{@boundary}\r\n" + encode_form_data(params)
216
+ payload = encode_form_data(params) + "--#{@boundary}-- \r\n"
217
217
headers[:'content-type'] = "multipart/form-data; boundary=#{@boundary}"
218
218
else
219
219
payload = encode(params)
@@ -284,16 +284,18 @@ module {{ spec.title | caseUcfirst }}
284
284
else
285
285
post_body = []
286
286
if value.instance_of? InputFile
287
- post_body << "Content-Disposition: form-data; name=\"#{key}\"; filename=\"#{value.filename}\"\r\n"
288
- post_body << "Content-Type: #{value.mime_type}\r\n\r\n"
287
+ post_body << "--#{@boundary}"
288
+ post_body << "Content-Disposition: form-data; name=\"#{key}\"; filename=\"#{value.filename}\""
289
+ post_body << "Content-Type: #{value.mime_type}"
290
+ post_body << ""
289
291
post_body << value.data
290
- post_body << "\r\n--#{@boundary}--\r\n"
291
- else
292
- post_body << "Content-Disposition: form-data; name=\"#{key}\"\r\n\r\n "
293
- post_body << "#{value.to_s}"
294
- post_body << "\r\n--#{@boundary}\r\n"
292
+ else
293
+ post_body << "--#{@boundary}"
294
+ post_body << "Content-Disposition: form-data; name=\"#{key}\""
295
+ post_body << ""
296
+ post_body << value.to_s
295
297
end
296
- post_body.join
298
+ post_body.join("\r\n") + "\r\n"
297
299
end
298
300
end
299
301
You can’t perform that action at this time.
0 commit comments