Multipart form-data with cyrillics are replaced by '?'
See original GitHub issueHere is my method for example:
public void postSomething(){
RestAssured.config = RestAssured.config()
.encoderConfig(encoderConfig().defaultContentCharset("UTF-8"))
.encoderConfig(encoderConfig().defaultCharsetForContentType("UTF-8", "multipart/form-data"))
.multiPartConfig(multiPartConfig().defaultCharset("UTF-8"))
.decoderConfig(decoderConfig().defaultContentCharset("UTF-8"))
.decoderConfig(decoderConfig().defaultCharsetForContentType("UTF-8", "multipart/form-data"));
String response = given().log().all()
.multiPart(new MultiPartSpecBuilder(Charsets.UTF_8).build())
.config(RestAssuredConfig.config().httpClient(HttpClientConfig.httpClientConfig()
.httpMultipartMode(HttpMultipartMode.BROWSER_COMPATIBLE)))
.contentType("multipart/form-data; charset=UTF-8")
.multiPart("cyrillic", "ЙЦУКЕН фывап")
.when()
.post("http://df4d777e.ngrok.io/123")
.then().log().all()
.assertThat().extract().response().body().asString();
}
Console logs looks fine i guess
but on server it looks like this
Windows 10 Rest-assured 4.1.2
Is there anything i’m doing wrong?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
RestEasy - upload file (multipart/form-data) with cyrillic name
I tried a couple of ways to change it: With new String(filename.getBytes("US-ASCII"), "UTF-8") - didn't work; ...
Read more >Problems with the filename encoding when upload... - JBoss.org
Hello guys. I have this problem and I tried couple of things. Nothing has worked. Could you please follow this question:
Read more >Multipart (Form Data) Format - MuleSoft Documentation
DataWeave supports Multipart subtypes, in particular form-data . These formats enable you to handle several different data parts in a single payload, ...
Read more >Encoding problems when using multipart/form-data - Forums
When I remove the enctype="multipart/form-data" attribute needed for file uploads, ... I turned parseUtf8PostData on and the behaviour didn't change.
Read more >Setting different content-type for form fields in multipart/form-data
Hello all, I am using the HTTP Request Wizard to upload a file along with Json to specify how the end-point will 'process'...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Try this .multiPart(new MultiPartSpecBuilder(“ЙЦУКЕН фывап”).controlName(“cyrillic”).charset(StandardCharsets.UTF_8).build())
Thanks a lot!! It’s worked for me!