Skip to content

Commit

Permalink
Added new content type multi-part (#1473)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
yusuf-tayman and yusuftayman authored May 21, 2021
1 parent 1cdb73c commit 5291cf1
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion rest-assured/src/main/java/io/restassured/http/ContentType.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,22 @@ public enum ContentType {
/**
* <code>application/octet-stream</code>
*/
BINARY("application/octet-stream");
BINARY("application/octet-stream"),
/**
* <ul>
* <li><code>multipart/form-data</code></li>
* <li><code>multipart/alternative</code></li>
* <li><code>multipart/byteranges</code></li>
* <li><code>multipart/digest</code></li>
* <li><code>multipart/mixed</code></li>
* <li><code>multipart/parallel</code></li>
* <li><code>multipart/related</code></li>
* <li><code>multipart/report</code></li>
* <li><code>multipart/signed</code></li>
* <li><code>multipart/encrypted</code></li>
* </ul>
*/
MULTIPART("multipart/form-data", "multipart/alternative", "multipart/byteranges", "multipart/digest", "multipart/mixed", "multipart/parallel", "multipart/related", "multipart/report", "multipart/signed", "multipart/encrypted");

private static final String PLUS_XML = "+xml";
private static final String PLUS_JSON = "+json";
Expand Down Expand Up @@ -170,6 +185,8 @@ public static ContentType fromContentType(String contentType) {
foundContentType = BINARY;
} else if (contains(ANY.ctStrings, contentType)) {
foundContentType = ANY;
} else if (contains(MULTIPART.ctStrings, contentType)) {
foundContentType = MULTIPART;
} else {
foundContentType = null;
}
Expand Down

0 comments on commit 5291cf1

Please sign in to comment.