@Multipart
@FormUrlEncoded
@POST(Endpoints.KID_PROFILE_BASE + "/{uuid}" + Endpoints.POST_KID_PROFILE_END)
void postKidProfilePhoto(@Path(value = "uuid", encode = false) String startuuid, @Part("post[body]") TypedString requestJson, Callback<KidProfile> callback);
我有上面的代码。此POST
应格式化动态网址(使用FormUrlEncoded),然后使用Body
TypedString
数据填充Json
参数。
但是当我向网址发出请求时,retrofit
会抛出错误:
Only one encoding annotation is allowed.
这意味着我必须放弃@Multipart
或@FormUrlEncoded
。有没有办法保留它们两个为了不丢弃动态生成我的网址?还是一个解决方法?
我知道我可以移除@FormUrlEncoded
并以某种方式将其作为@Part
添加到我的postKidProfilePhoto
中,但我不确定执行此操作的程序,并且无法找到任何显示已完成的文档