是否可以使用多部分表单数据执行PUT请求?Superagent:PUT-ing多部分表单数据
随着Superagent我希望以下工作,但它不。
var request = Request
.put("http://localhost:8080/upload_file")
.field("name", file.name)
.field("size", file.size)
.attach("file", file.file, file.file.name)
.accept("application/json")
如果我做了一个帖子,它的工作原理。不同的是内容类型。通过成功的发布请求,内容类型是multipart/form-data; boundary=------WebKitFormBoundaryXg34NkBFcYWq60mH
。
如果我手动设置,我怎么知道边界应该是什么?它似乎是由Superagent自动生成的。
superagent是一个节点库,不是PHP的 –