Skip to content

Commit 1047909

Browse files
committed
update custom MultipartBody to use MediaType.parse() method instead of depending the MediaType.get() in okhttp 3.11.0 and higher version.
1 parent 829b7b7 commit 1047909

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

library/src/main/java/com/qiniu/android/http/MultipartBody.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,34 +38,34 @@ public final class MultipartBody extends RequestBody {
3838
* need to be bundled in a particular order. Any "multipart" subtypes that an implementation does
3939
* not recognize must be treated as being of subtype "mixed".
4040
*/
41-
public static final MediaType MIXED = MediaType.get("multipart/mixed");
41+
public static final MediaType MIXED = MediaType.parse("multipart/mixed");
4242

4343
/**
4444
* The "multipart/alternative" type is syntactically identical to "multipart/mixed", but the
4545
* semantics are different. In particular, each of the body parts is an "alternative" version of
4646
* the same information.
4747
*/
48-
public static final MediaType ALTERNATIVE = MediaType.get("multipart/alternative");
48+
public static final MediaType ALTERNATIVE = MediaType.parse("multipart/alternative");
4949

5050
/**
5151
* This type is syntactically identical to "multipart/mixed", but the semantics are different. In
5252
* particular, in a digest, the default {@code Content-Type} value for a body part is changed from
5353
* "text/plain" to "message/rfc822".
5454
*/
55-
public static final MediaType DIGEST = MediaType.get("multipart/digest");
55+
public static final MediaType DIGEST = MediaType.parse("multipart/digest");
5656

5757
/**
5858
* This type is syntactically identical to "multipart/mixed", but the semantics are different. In
5959
* particular, in a parallel entity, the order of body parts is not significant.
6060
*/
61-
public static final MediaType PARALLEL = MediaType.get("multipart/parallel");
61+
public static final MediaType PARALLEL = MediaType.parse("multipart/parallel");
6262

6363
/**
6464
* The media-type multipart/form-data follows the rules of all multipart MIME data streams as
6565
* outlined in RFC 2046. In forms, there are a series of fields to be supplied by the user who
6666
* fills out the form. Each field has a name. Within a given form, the names are unique.
6767
*/
68-
public static final MediaType FORM = MediaType.get("multipart/form-data");
68+
public static final MediaType FORM = MediaType.parse("multipart/form-data");
6969

7070
private static final byte[] COLONSPACE = {':', ' '};
7171
private static final byte[] CRLF = {'\r', '\n'};

0 commit comments

Comments
 (0)