[英]Is it possible to send Json Data in the POST request body and an image as form-data
I have a POST request that has an image attached as form-data.我有一个 POST 请求,其中附有图像作为表单数据。 I would like to send additional data as json in the request body.
我想在请求正文中以 json 的形式发送附加数据。 Is this possible?
这可能吗?
Thanks!谢谢!
Within a single Request call is not possible.在单个请求调用中是不可能的。 as you can only define one type of body.
因为您只能定义一种类型的主体。
One way you can do it is to stringify your json object and sent it as a string params in your form-data一种方法是对 json object 进行字符串化,并将其作为字符串参数发送到表单数据中
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.