类 MockHttpOutputMessage

java.lang.Object
cn.taketoday.mock.http.MockHttpOutputMessage
所有已实现的接口:
cn.taketoday.http.HttpMessage, cn.taketoday.http.HttpOutputMessage
直接已知子类:
MockClientHttpRequest

public class MockHttpOutputMessage extends Object implements cn.taketoday.http.HttpOutputMessage
Mock implementation of HttpOutputMessage.
从以下版本开始:
4.0
作者:
Rossen Stoyanchev
  • 字段详细资料

    • headers

      private final cn.taketoday.http.HttpHeaders headers
    • body

      private final ByteArrayOutputStream body
  • 构造器详细资料

    • MockHttpOutputMessage

      public MockHttpOutputMessage()
  • 方法详细资料

    • getHeaders

      public cn.taketoday.http.HttpHeaders getHeaders()
      Return the headers.
      指定者:
      getHeaders 在接口中 cn.taketoday.http.HttpMessage
    • getBody

      public OutputStream getBody() throws IOException
      Return the body content.
      指定者:
      getBody 在接口中 cn.taketoday.http.HttpOutputMessage
      抛出:
      IOException
    • getBodyAsBytes

      public byte[] getBodyAsBytes()
      Return body content as a byte array.
    • getBodyAsString

      public String getBodyAsString()
      Return the body content interpreted as a UTF-8 string.
    • getBodyAsString

      public String getBodyAsString(Charset charset)
      Return the body content as a string.
      参数:
      charset - the charset to use to turn the body content to a String