You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Retrofit 2 in my application, it is great and very easy to learn. But I still met some issues when I tried to uploading files using Retrofit 2, the biggest one is that I didn't know how to specify the filename of uploading file. I finally got a solution by googling, it looks like this:
It work for me, but in my opinion this looks more like a work around, I think there should be another solution which is more elegant and straightforward.
I suggest to add a new property named "filename" to @part as following:
@documented @target(PARAMETER) @retention(RUNTIME)
public @interface Part {
String value();
String filename() default "";
/** The {@code Content-Transfer-Encoding} of this part. */
String encoding() default "binary";
}
Is this acceptable?Or any comments on this?
Thanks!
The text was updated successfully, but these errors were encountered:
I am using Retrofit 2 in my application, it is great and very easy to learn. But I still met some issues when I tried to uploading files using Retrofit 2, the biggest one is that I didn't know how to specify the filename of uploading file. I finally got a solution by googling, it looks like this:
It work for me, but in my opinion this looks more like a work around, I think there should be another solution which is more elegant and straightforward.
I suggest to add a new property named "filename" to @part as following:
@documented
@target(PARAMETER)
@retention(RUNTIME)
public @interface Part {
String value();
String filename() default "";
/** The {@code Content-Transfer-Encoding} of this part. */
String encoding() default "binary";
}
Is this acceptable?Or any comments on this?
Thanks!
The text was updated successfully, but these errors were encountered: