Package 

Class Call

  • All Implemented Interfaces:

    
    public final class Call
    
                        

    HTTP request context. It holds client supplied data and methods to change the response.

    • Method Detail

      • getAttributes

         final Map<String, Object> getAttributes()

        Call attributes (for the current request). Same as HttpServletRequest.setAttribute().

      • ok

         final Unit ok(Object content, String contentType)

        Sends success response with given content type.

        Parameters:
        content - Content of the response.
        contentType - Content type of the response.
      • ok

         final Unit ok(Object content, SerializationFormat serializationFormat, Charset charset)

        Sends success response serialized using given SerializationFormat and Charset.

        Parameters:
        content - Content of the response.
        serializationFormat - Serialization format for serializing the response.
        charset - Character Set to be used for the content type.
      • send

         final Unit send(Integer code, Object content, String contentType)

        Sends response to the client.

        Parameters:
        code - Status code of the response.
        content - Content of the response.
        contentType - Content type of the response.
      • send

         final Unit send(Integer code, Object content, SerializationFormat serializationFormat, Charset charset)

        Sends response to the client after serializing using given SerializationFormat and Charset.

        Parameters:
        code - Status code of the response.
        content - Content of the response.
        serializationFormat - Serialization format for serializing the response.
        charset - Character Set to be used for the content type.
      • send

         final Unit send(Integer code, Object content, ContentType contentType)

        Sends response to the client after serializing using given ContentType instance.

        Parameters:
        code - Status code of the response.
        content - Content of the response.
        contentType - Content type of the response.
      • halt

         final Void halt(Object content)

        Sends error response.

        Parameters:
        content - Message for error response.
      • halt

         final Void halt(Integer code, Object content)

        Sends error response.

        Parameters:
        code - Status code for error response.
        content - Message for error response.
      • redirect

         final Unit redirect(String url)

        Sends a redirect response to the client using the specified redirect URL.

        Parameters:
        url - Redirect URL.