development
(default)production
info
(default)debug
- 180 (default)
- 1 (default)
- 3 (default)
传递数组 data 参数,转化成 xls
result = RestClient::Request.execute({
method: :post,
url: 'http://localhost:9292/array',
raw_response: true,
payload: {'filename' => 'text.xls', 'data' => [['test']]}.to_json,
headers: {content_type: :json, accept: :json}
})
上传 csv 文件,转化为 xls
# 生成一个 csv 文件
file = Tempfile.new
file.write <<-EOF
1,2
3,4
EOF
file.close
# 上传 csv 文件
result = RestClient::Request.execute({
method: :post,
url: 'http://localhost:9292/csv',
raw_response: true,
payload: {'filename' => 'test.xls', 'file' => File.open(file, r)}.to_json,
headers: {content_type: :json, accept: :json}
})
version: '3'
services:
spreadsheet-microservice:
image: agideo/spreadsheet-microservice:latest