How to add custom header to retrofit request body part?
问题 So I am building a multipart request using retrofit and I want to add a custom header to one one of the part. I have tried a lot of things but nothing seems to be working. The photo shows a body request that contains 4 parts. Each part contains a body and a header, what I want is to add a custom header to the selected part. How can I do that? 回答1: So just to answer my own question, I create a part with an image and a custom header like this: MultipartBody.Part body = MultipartBody.Part.create