Skip to content

Commit 5291cf1

Browse files
yusuf-taymanyusuftayman
andauthored
Added new content type multi-part (#1473)
* When working with multi-part, multi-part should be selected from ContentType. * added all of the multipart types Co-authored-by: yusuftayman <yusuf.tayman@openpayd.com.tr>
1 parent 1cdb73c commit 5291cf1

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

rest-assured/src/main/java/io/restassured/http/ContentType.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,22 @@ public enum ContentType {
8686
/**
8787
* <code>application/octet-stream</code>
8888
*/
89-
BINARY("application/octet-stream");
89+
BINARY("application/octet-stream"),
90+
/**
91+
* <ul>
92+
* <li><code>multipart/form-data</code></li>
93+
* <li><code>multipart/alternative</code></li>
94+
* <li><code>multipart/byteranges</code></li>
95+
* <li><code>multipart/digest</code></li>
96+
* <li><code>multipart/mixed</code></li>
97+
* <li><code>multipart/parallel</code></li>
98+
* <li><code>multipart/related</code></li>
99+
* <li><code>multipart/report</code></li>
100+
* <li><code>multipart/signed</code></li>
101+
* <li><code>multipart/encrypted</code></li>
102+
* </ul>
103+
*/
104+
MULTIPART("multipart/form-data", "multipart/alternative", "multipart/byteranges", "multipart/digest", "multipart/mixed", "multipart/parallel", "multipart/related", "multipart/report", "multipart/signed", "multipart/encrypted");
90105

91106
private static final String PLUS_XML = "+xml";
92107
private static final String PLUS_JSON = "+json";
@@ -170,6 +185,8 @@ public static ContentType fromContentType(String contentType) {
170185
foundContentType = BINARY;
171186
} else if (contains(ANY.ctStrings, contentType)) {
172187
foundContentType = ANY;
188+
} else if (contains(MULTIPART.ctStrings, contentType)) {
189+
foundContentType = MULTIPART;
173190
} else {
174191
foundContentType = null;
175192
}

0 commit comments

Comments
 (0)