这是对服务器的API put调用,我希望将startup_public_video
设置为startup
,如预期的Params中所述。谁能指导?
var data = new FormData();
data.append(key,values[0])
data.set("startup",data)
axios.put(`/startups/${this.permalink}.json`,data)
当前参数:
{"startup_public_video"=>#<ActionDispatch::Http::UploadedFile:0x007f4b086a7e58 @tempfile=#<Tempfile:/tmp/RackMultipart20190510-20041-10xb48f.mp4> ....}
预期参数:
{
"startup"=>{
"startup_public_video"=>#<ActionDispatch: : Http: : UploadedFile: 0x007fc3b1623cf8@tempfile=#<Tempfile: /tmp/RackMultipart20190510-6185-14u6780.mp4> ....... >
}
我的代码有什么问题?预先感谢