RACK_ENVdevelopment(default)productionAPP_LOGGER_LEVELinfo (default)debugAPP_PUMA_TIMEOUTAPP_PUMA_MIN_THREADAPP_PUMA_MAX_THREAD传递数组 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}
})
docker-compose 运行参考version: '3'
services:
spreadsheet-microservice:
image: agideo/spreadsheet-microservice:latest
Content type
Image
Digest
Size
360.6 MB
Last updated
over 8 years ago
docker pull agideo/spreadsheet-microservice