http/HttpMethod.java

twilio-java · src/main/java/com/twilio/http/HttpMethod.java · java · MIT
voice, Voice / Speech

Enum of HTTP methods with JSON serialization support, used for request construction.

// Source: https://github.com/twilio/twilio-java | License: MIT | Copyright 2023, Twilio, Inc. <https://www.twilio.com/help/contact>
// Provided via justclaw.it.com; keep this notice with the code.
package com.twilio.http;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.twilio.converter.Promoter;

public enum HttpMethod {
    GET("GET"),
    POST("POST"),
    PUT("PUT"),
    PATCH("PATCH"),
    DELETE("DELETE"),
    HEAD("HEAD"),
    OPTIONS("OPTIONS");

    private final String method;

    HttpMethod(final String method) {
        this.method = method;
    }

    public String toString() {
        return method;
    }

    @JsonCreator
    public static HttpMethod forValue(final String value) {
        return Promoter.enumFromString(value, HttpMethod.values());
    }
}

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key