HttpMethod: {
    Delete: "DELETE";
    Get: "GET";
    Patch: "PATCH";
    Post: "POST";
    Put: "PUT";
} = ...

HTTP method constants

Standard HTTP methods as constant values. Useful for type-safe method selection in custom HTTP utilities.

Example

function makeRequest(method: HttpMethod, url: string) {
if (method === HttpMethod.Get) {
// Handle GET request
}
}

makeRequest(HttpMethod.Post, 'my_addon/endpoint');

Type declaration

  • Delete: "DELETE"
  • Get: "GET"
  • Patch: "PATCH"
  • Post: "POST"
  • Put: "PUT"