use of com.gargoylesoftware.htmlunit.FormEncodingType in project spring-security by spring-projects.
the class HtmlUnitWebTestClient method contentType.
private void contentType(WebTestClient.RequestBodySpec request, WebRequest webRequest) {
String contentType = header("Content-Type", webRequest);
if (contentType == null) {
FormEncodingType encodingType = webRequest.getEncodingType();
if (encodingType != null) {
contentType = encodingType.getName();
}
}
MediaType mediaType = (contentType != null) ? MediaType.parseMediaType(contentType) : MediaType.ALL;
request.contentType(mediaType);
}
Aggregations