Package org.springframework.http

Examples of org.springframework.http.HttpInputMessage


    private void handleResponseBody(Object returnValue, ServletWebRequest webRequest)
        throws Exception {
      if (returnValue == null) {
        return;
      }
      HttpInputMessage inputMessage = createHttpInputMessage(webRequest);
      HttpOutputMessage outputMessage = createHttpOutputMessage(webRequest);
      writeWithMessageConverters(returnValue, inputMessage, outputMessage);
    }
View Full Code Here


    private void handleHttpEntityResponse(HttpEntity<?> responseEntity, ServletWebRequest webRequest)
        throws Exception {
      if (responseEntity == null) {
        return;
      }
      HttpInputMessage inputMessage = createHttpInputMessage(webRequest);
      HttpOutputMessage outputMessage = createHttpOutputMessage(webRequest);
      if (responseEntity instanceof ResponseEntity && outputMessage instanceof ServerHttpResponse) {
        ((ServerHttpResponse)outputMessage).setStatusCode(((ResponseEntity) responseEntity).getStatusCode());
      }
      HttpHeaders entityHeaders = responseEntity.getHeaders();
View Full Code Here

  @SuppressWarnings("unchecked")
  private ModelAndView handleResponseBody(Object returnValue, ServletWebRequest webRequest)
      throws ServletException, IOException {

    HttpInputMessage inputMessage = new ServletServerHttpRequest(webRequest.getRequest());
    List<MediaType> acceptedMediaTypes = inputMessage.getHeaders().getAccept();
    if (acceptedMediaTypes.isEmpty()) {
      acceptedMediaTypes = Collections.singletonList(MediaType.ALL);
    }
    MediaType.sortByQualityValue(acceptedMediaTypes);
    HttpOutputMessage outputMessage = new ServletServerHttpResponse(webRequest.getResponse());
View Full Code Here

  }

  private HttpEntity resolveHttpEntityRequest(MethodParameter methodParam, NativeWebRequest webRequest)
      throws Exception {

    HttpInputMessage inputMessage = createHttpInputMessage(webRequest);
    Class<?> paramType = getHttpEntityType(methodParam);
    Object body = readWithMessageConverters(methodParam, inputMessage, paramType);
    return new HttpEntity<Object>(body, inputMessage.getHeaders());
  }
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    private ModelAndView handleResponseBody(Object body, ServletWebRequest webRequest) throws ServletException, IOException {

        HttpInputMessage inputMessage = new ServletServerHttpRequest(webRequest.getRequest());

        List<MediaType> acceptedMediaTypes = inputMessage.getHeaders().getAccept();
        if (acceptedMediaTypes.isEmpty()) {
            acceptedMediaTypes = Collections.singletonList(MediaType.ALL);
        }

        MediaType.sortByQualityValue(acceptedMediaTypes);
View Full Code Here

TOP

Related Classes of org.springframework.http.HttpInputMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.