org.springframework.http.client

Class AbstractClientHttpRequest

  • java.lang.Object
    • org.springframework.http.client.AbstractClientHttpRequest
    • Constructor Detail

      • AbstractClientHttpRequest

        public AbstractClientHttpRequest()
    • Method Detail

      • getHeaders

        public final HttpHeaders getHeaders()
        Description copied from interface: HttpMessage
        Return the headers of this message.
        Specified by:
        getHeaders in interface HttpMessage
        Returns:
        a corresponding HttpHeaders object (never null)
      • getBody

        public final java.io.OutputStream getBody()
                                           throws java.io.IOException
        Description copied from interface: HttpOutputMessage
        Return the body of the message as an output stream.
        Specified by:
        getBody in interface HttpOutputMessage
        Returns:
        the output stream body (never null)
        Throws:
        java.io.IOException - in case of I/O errors
      • assertNotExecuted

        protected void assertNotExecuted()
        Assert that this request has not been executed yet.
        Throws:
        java.lang.IllegalStateException - if this request has been executed
      • getBodyInternal

        protected abstract java.io.OutputStream getBodyInternal(HttpHeaders headers)
                                                         throws java.io.IOException
        Abstract template method that returns the body.
        Parameters:
        headers - the HTTP headers
        Returns:
        the body output stream
        Throws:
        java.io.IOException
      • executeInternal

        protected abstract ClientHttpResponse executeInternal(HttpHeaders headers)
                                                       throws java.io.IOException
        Abstract template method that writes the given headers and content to the HTTP request.
        Parameters:
        headers - the HTTP headers
        Returns:
        the response object for the executed request
        Throws:
        java.io.IOException