【发布时间】:2022-02-01 20:09:57
【问题描述】:
https://docs.rs/reqwest/latest/reqwest/blocking/multipart/struct.Form.html 的文档显示了从文件创建 multipart::Form 的示例。
let file = reqwest::blocking::multipart::Form::new().file("key", "/path/to/file")?;
let response = reqwest::blocking::Client::new()
.post("https:://test.com.br/send")
.multipart(file)
.send()
.unwrap();
但函数“.file”仅在reqwest的阻塞版本上可用(reqwest::blocking::multipart::Form)。
我已经测试了阻止版本,并且能够发送表单。但是我找不到使用异步版本(reqwest::multipart::Form)的方法。
是否有其他方法可以使用异步版本进行此调用?
【问题讨论】:
标签: asynchronous rust multipart reqwest