我想用 Retrofit 上传一个文件。但我必须用小写标题发送我的请求。
我试图覆盖标题但没有任何效果:
@Multipart
@PUT
fun uploadFile(
@Url url: String,
@Header("content-type") contentType: String,
@Header("content-disposition") contentDisposition: String,
@Header("content-length") contentLength: String,
@Part file: MultipartBody.Part
): Completable
改造日志:
D/OkHttp: Content-Type: image/jpeg
D/OkHttp: Content-Length: 755543
D/OkHttp: content-disposition: inline; filename=IMG-20190502-WA0000.jpeg
我想要内容类型和内容长度而不是内容类型和内容长度
提前致谢