Class HttpMethod

  • All Implemented Interfaces:
    Renderable, SingletonValueRenderable, java.io.Serializable, scala.Equals, scala.Product

    public final class HttpMethod
    extends HttpMethod
    implements SingletonValueRenderable, scala.Product, java.io.Serializable
    The method of an HTTP request. param: isSafe true if the resource should not be altered on the server param: isIdempotent true if requests can be safely (& automatically) repeated param: requestEntityAcceptance Expected if meaning of request entities is properly defined param: contentLengthAllowed Function defining whether the method-statuscode combination should output the Content-Length header.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      HttpMethod​(java.lang.String value, boolean isSafe, boolean isIdempotent, RequestEntityAcceptance requestEntityAcceptance, scala.Function1<StatusCode,​java.lang.Object> contentLengthAllowed)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      scala.Function1<StatusCode,​java.lang.Object> contentLengthAllowed()  
      static HttpMethod custom​(java.lang.String name)
      Creates a custom method by name and assumes properties conservatively to be safe = false, idempotent = false, requestEntityAcceptance = Expected and contentLengthAllowed always true.
      static HttpMethod custom​(java.lang.String name, boolean safe, boolean idempotent, RequestEntityAcceptance requestEntityAcceptance)
      Deprecated.
      The created method will compute the presence of Content-Length headers based on deprecated logic (before issue #4213).
      static HttpMethod custom​(java.lang.String name, boolean safe, boolean idempotent, RequestEntityAcceptance requestEntityAcceptance, boolean contentLengthAllowed)
      Create a custom method type.
      boolean isEntityAccepted()
      Returns if requests with this method may contain an entity.
      boolean isIdempotent()
      Returns if this method is "idempotent" as defined in http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-26#section-4.2.2
      boolean isSafe()
      Returns if this method is "safe" as defined in http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-26#section-4.2.1
      RequestEntityAcceptance requestEntityAcceptance()  
      java.lang.String toString()  
      java.lang.String value()
      Returns the name of the method.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface scala.Equals

        canEqual, equals
      • Methods inherited from interface scala.Product

        productArity, productElement, productElementName, productElementNames, productIterator, productPrefix
    • Constructor Detail

      • HttpMethod

        public HttpMethod​(java.lang.String value,
                          boolean isSafe,
                          boolean isIdempotent,
                          RequestEntityAcceptance requestEntityAcceptance,
                          scala.Function1<StatusCode,​java.lang.Object> contentLengthAllowed)
    • Method Detail

      • custom

        public static HttpMethod custom​(java.lang.String name,
                                        boolean safe,
                                        boolean idempotent,
                                        RequestEntityAcceptance requestEntityAcceptance)
        Deprecated.
        The created method will compute the presence of Content-Length headers based on deprecated logic (before issue #4213).
        Create a custom method type.
        Parameters:
        name - (undocumented)
        safe - (undocumented)
        idempotent - (undocumented)
        requestEntityAcceptance - (undocumented)
        Returns:
        (undocumented)
      • custom

        public static HttpMethod custom​(java.lang.String name,
                                        boolean safe,
                                        boolean idempotent,
                                        RequestEntityAcceptance requestEntityAcceptance,
                                        boolean contentLengthAllowed)
        Create a custom method type.
        Parameters:
        name - (undocumented)
        safe - (undocumented)
        idempotent - (undocumented)
        requestEntityAcceptance - (undocumented)
        contentLengthAllowed - (undocumented)
        Returns:
        (undocumented)
      • custom

        public static HttpMethod custom​(java.lang.String name)
        Creates a custom method by name and assumes properties conservatively to be safe = false, idempotent = false, requestEntityAcceptance = Expected and contentLengthAllowed always true.
        Parameters:
        name - (undocumented)
        Returns:
        (undocumented)
      • isSafe

        public boolean isSafe()
        Description copied from class: HttpMethod
        Returns if this method is "safe" as defined in http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-26#section-4.2.1
        Specified by:
        isSafe in class HttpMethod
      • isIdempotent

        public boolean isIdempotent()
        Description copied from class: HttpMethod
        Returns if this method is "idempotent" as defined in http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-26#section-4.2.2
        Specified by:
        isIdempotent in class HttpMethod
      • contentLengthAllowed

        public scala.Function1<StatusCode,​java.lang.Object> contentLengthAllowed()
      • isEntityAccepted

        public boolean isEntityAccepted()
        Description copied from class: HttpMethod
        Returns if requests with this method may contain an entity.
        Specified by:
        isEntityAccepted in class HttpMethod
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object