File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
templates/ruby/lib/container Expand file tree Collapse file tree 1 file changed +5
-4
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}--"
217
217
headers[:'content-type'] = "multipart/form-data; boundary=#{@boundary}"
218
218
else
219
219
payload = encode(params)
@@ -284,14 +284,15 @@ module {{ spec.title | caseUcfirst }}
284
284
else
285
285
post_body = []
286
286
if value.instance_of? InputFile
287
+ post_body << "--#{@boundary}\r\n"
287
288
post_body << "Content-Disposition: form-data; name=\"#{key}\"; filename=\"#{value.filename}\"\r\n"
288
289
post_body << "Content-Type: #{value.mime_type}\r\n\r\n"
289
290
post_body << value.data
290
- post_body << "\r\n--#{@boundary}--\r\n"
291
- else
291
+
292
+ else
293
+ post_body << "--#{@boundary}\r\n"
292
294
post_body << "Content-Disposition: form-data; name=\"#{key}\"\r\n\r\n"
293
295
post_body << "#{value.to_s}"
294
- post_body << "\r\n--#{@boundary}\r\n"
295
296
end
296
297
post_body.join
297
298
end
You can’t perform that action at this time.
0 commit comments