Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot set multipart mime-type to a value with semi-colons in it #1774

Open
jagregory opened this issue Mar 5, 2024 · 0 comments
Open

Cannot set multipart mime-type to a value with semi-colons in it #1774

jagregory opened this issue Mar 5, 2024 · 0 comments

Comments

@jagregory
Copy link

Calling multiPart with a mime-type that has a parameter, which is a valid mime-type, results in an error:

.multiPart("file", "{}", "application/vnd.test;version=1")

Error:

MIME type may not contain reserved characters
	at org.apache.http.util.Args.check(Args.java:36)
	at org.apache.http.entity.ContentType.create(ContentType.java:229)
	at org.apache.http.entity.mime.content.StringBody.<init>(StringBody.java:113)

The org.apache.http.entity.ContentType.create function does not permit values with parameters, you need to use the ContentType.parse function instead, but there's no way (that I can see) in rest-assured to pass your own ContentType instance, only strings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant