Enum Class HTTPMethode

java.lang.Object
java.lang.Enum<HTTPMethode>
com.ns.tcpframework.HTTPMethode
All Implemented Interfaces:
Serializable, Comparable<HTTPMethode>, Constable

public enum HTTPMethode extends Enum<HTTPMethode>
Enumeration representing the HTTP request methods supported by the framework.

This enum defines the standard HTTP methods as specified in RFC 7231 (HTTP/1.1) and RFC 5789 (PATCH). Each method has a specific semantic meaning that defines the intent of the request operation.

HTTP methods are used to indicate the desired action to be performed on the identified resource. The method determines how the server should process the request and what type of response to generate.

Method properties:

  • Safe methods: GET, HEAD, OPTIONS - Read-only operations that don't modify server state
  • Idempotent methods: GET, HEAD, PUT, DELETE, OPTIONS - Multiple identical requests have the same effect as a single request
  • Cacheable methods: GET, HEAD, POST - Responses may be cached by clients or proxies
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class Enum

    Enum.EnumDesc<E>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    DELETE method - Deletes the specified resource.
    GET method - Retrieves a representation of the specified resource.
    HEAD method - Retrieves the headers for a resource without the response body.
    OPTIONS method - Describes the communication options for the target resource.
    POST method - Submits data to be processed by the specified resource.
    PUT method - Replaces all current representations of the target resource with the request payload.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the enum constant of this class with the specified name.
    static HTTPMethode[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • GET

      public static final HTTPMethode GET
      GET method - Retrieves a representation of the specified resource.

      The GET method requests a representation of the specified resource. Requests using GET should only retrieve data and should have no other effect on the server state.

      Characteristics:

      • Safe: Yes (read-only operation)
      • Idempotent: Yes (multiple requests return the same result)
      • Cacheable: Yes
      • Request has body: No (typically)
      • Response has body: Yes

      Common use cases: Fetching web pages, retrieving API resources, downloading files

    • POST

      public static final HTTPMethode POST
      POST method - Submits data to be processed by the specified resource.

      The POST method submits an entity to the specified resource, often causing a change in state or side effects on the server. This is commonly used for creating new resources, submitting form data, or triggering server-side operations.

      Characteristics:

      • Safe: No (modifies server state)
      • Idempotent: No (multiple requests may have different effects)
      • Cacheable: Yes (with appropriate headers)
      • Request has body: Yes
      • Response has body: Yes

      Common use cases: Creating new resources, submitting forms, uploading files, processing payments

    • PUT

      public static final HTTPMethode PUT
      PUT method - Replaces all current representations of the target resource with the request payload.

      The PUT method replaces the entire target resource with the provided representation. If the resource doesn't exist, it may be created. PUT is typically used for updates where the entire resource is replaced.

      Characteristics:

      • Safe: No (modifies server state)
      • Idempotent: Yes (multiple identical requests result in the same state)
      • Cacheable: No
      • Request has body: Yes
      • Response has body: Typically no (may return success status)

      Common use cases: Updating existing resources, replacing entire entities, uploading files to specific URLs

    • DELETE

      public static final HTTPMethode DELETE
      DELETE method - Deletes the specified resource.

      The DELETE method removes the specified resource from the server. Multiple identical DELETE requests should have the same effect as a single request (idempotent).

      Characteristics:

      • Safe: No (modifies server state)
      • Idempotent: Yes (deleting a resource multiple times results in the same state)
      • Cacheable: No
      • Request has body: May have (not typical)
      • Response has body: May have (typically status confirmation)

      Common use cases: Removing resources, deleting database records, cleaning up temporary files

    • OPTIONS

      public static final HTTPMethode OPTIONS
      OPTIONS method - Describes the communication options for the target resource.

      The OPTIONS method requests information about the communication options available for the target resource. This is commonly used to discover which HTTP methods are supported by the server for a specific resource (indicated by the Allow header).

      Characteristics:

      • Safe: Yes (read-only operation)
      • Idempotent: Yes (multiple requests return the same options)
      • Cacheable: No
      • Request has body: No
      • Response has body: Typically minimal (may describe options)

      Common use cases: CORS preflight requests, discovering supported methods, API capability discovery

  • Method Details

    • values

      public static HTTPMethode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static HTTPMethode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null