带有 multipart/form-data 的 MutableHttpRequest

问题描述

我有一个应用程序充当其他应用程序的代理。这通常工作正常,但是当给定多部分文件时,它会引发错误

io.micronaut.http.multipart.MultipartException: The type java.lang.String is not a supported type for a multipart request body

代理针对的控制器具有以下控制器:

@Post(value = "/file",consumes = MediaType.MULTIPART_FORM_DATA)
HttpResponse upload(CompletedFileUpload file) {}

代理正在执行以下 HTTP 请求:

MutableHttpRequest<String> req;
req = HttpRequest.POST(uri,body);
Flowable<HttpResponse<String>> call = client.exchange(req,String.class);

我尝试将 MutableHttpRequest 的类型更改为 byte[],但这又引发了另一个错误

multipartexception the type B is not a supported type

有人能帮我找到正确的方向吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)