Class RestResponse

  • Direct Known Subclasses:

    public abstract class RestResponse
    extends java.lang.Object
    • Field Summary

      Modifier and Type Field Description
      protected java.util.Map<java.lang.String,​java.util.List<java.lang.String>> customHeaders  
    • Constructor Summary

      Constructor Description
    • Field Detail

      • customHeaders

        protected java.util.Map<java.lang.String,​java.util.List<java.lang.String>> customHeaders
    • Constructor Detail

      • RestResponse

        public RestResponse()
    • Method Detail

      • contentType

        public abstract java.lang.String contentType()
        The response content type.
      • content

        public abstract BytesReference content()
        The response content. Note, if the content is Releasable it should automatically be released when done by the channel sending it.
      • status

        public abstract RestStatus status()
        The rest status code.
      • addHeader

        public void addHeader​(java.lang.String name,
                              java.lang.String value)
        Add a custom header.
      • getHeaders

        public java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getHeaders()
        Returns custom headers that have been added, or null if none have been set.