Search in sources :

Example 1 with FormEncodingType

use of com.gargoylesoftware.htmlunit.FormEncodingType in project spring-framework-debug by Joker-5.

the class HtmlUnitRequestBuilder method contentType.

private void contentType(MockHttpServletRequest request) {
    String contentType = header("Content-Type");
    if (contentType == null) {
        FormEncodingType encodingType = this.webRequest.getEncodingType();
        if (encodingType != null) {
            contentType = encodingType.getName();
        }
    }
    request.setContentType(contentType != null ? contentType : MediaType.ALL_VALUE);
}
Also used : FormEncodingType(com.gargoylesoftware.htmlunit.FormEncodingType)

Example 2 with FormEncodingType

use of com.gargoylesoftware.htmlunit.FormEncodingType in project spring-framework-5.2.9.RELEASE by somepeopleHavingDream.

the class HtmlUnitRequestBuilder method contentType.

private void contentType(MockHttpServletRequest request) {
    String contentType = header("Content-Type");
    if (contentType == null) {
        FormEncodingType encodingType = this.webRequest.getEncodingType();
        if (encodingType != null) {
            contentType = encodingType.getName();
        }
    }
    request.setContentType(contentType != null ? contentType : MediaType.ALL_VALUE);
}
Also used : FormEncodingType(com.gargoylesoftware.htmlunit.FormEncodingType)

Example 3 with FormEncodingType

use of com.gargoylesoftware.htmlunit.FormEncodingType in project spring-framework by bluecrow1986.

the class HtmlUnitRequestBuilder method contentType.

private void contentType(MockHttpServletRequest request) {
    String contentType = header("Content-Type");
    if (contentType == null) {
        FormEncodingType encodingType = this.webRequest.getEncodingType();
        if (encodingType != null) {
            contentType = encodingType.getName();
        }
    }
    request.setContentType(contentType != null ? contentType : MediaType.ALL_VALUE);
}
Also used : FormEncodingType(com.gargoylesoftware.htmlunit.FormEncodingType)

Example 4 with FormEncodingType

use of com.gargoylesoftware.htmlunit.FormEncodingType in project spring-framework by spring-projects.

the class HtmlUnitRequestBuilder method contentType.

private void contentType(MockHttpServletRequest request) {
    String contentType = header("Content-Type");
    if (contentType == null) {
        FormEncodingType encodingType = this.webRequest.getEncodingType();
        if (encodingType != null) {
            contentType = encodingType.getName();
        }
    }
    request.setContentType(contentType != null ? contentType : MediaType.ALL_VALUE);
}
Also used : FormEncodingType(com.gargoylesoftware.htmlunit.FormEncodingType)

Example 5 with FormEncodingType

use of com.gargoylesoftware.htmlunit.FormEncodingType in project springframework-source-5.1.x by wb02125055.

the class HtmlUnitRequestBuilder method contentType.

private void contentType(MockHttpServletRequest request) {
    String contentType = header("Content-Type");
    if (contentType == null) {
        FormEncodingType encodingType = this.webRequest.getEncodingType();
        if (encodingType != null) {
            contentType = encodingType.getName();
        }
    }
    request.setContentType(contentType != null ? contentType : MediaType.ALL_VALUE);
}
Also used : FormEncodingType(com.gargoylesoftware.htmlunit.FormEncodingType)

Aggregations

FormEncodingType (com.gargoylesoftware.htmlunit.FormEncodingType)6 MediaType (org.springframework.http.MediaType)1