Write form data without charset parameter
This commit updates the content-type for form data to not include the charset, unless it is different from the default charset. Some servers don't handle charset parameter and the spec is unclear. See gh-31781
This commit is contained in:
committed by
Stéphane Nicoll
parent
08998376cc
commit
b8715811f8
@@ -145,7 +145,7 @@ class WebClientAdapterTests {
|
||||
initService().postForm(map);
|
||||
|
||||
RecordedRequest request = this.server.takeRequest();
|
||||
assertThat(request.getHeaders().get("Content-Type")).isEqualTo("application/x-www-form-urlencoded;charset=UTF-8");
|
||||
assertThat(request.getHeaders().get("Content-Type")).isEqualTo("application/x-www-form-urlencoded");
|
||||
assertThat(request.getBody().readUtf8()).isEqualTo("param1=value+1¶m2=value+2");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user