HTTP Methods
The HTTP request methods — GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE, PATCH, and QUERY — with the properties that actually matter when designing an API: whether each is safe, idempotent, and cacheable, whether it carries a request body, and which specification defines it.
Quick fetch
Stable URL. CORS-enabled. No auth.
curl https://staticdata.dev/v1/http-methods.json
Or use as a typed import:
import { httpMethods } from "https://staticdata.dev/v1/http-methods.ts"
Formats
- JSON 2.6 KB
/v1/http-methods.json
min: 2.1 KB · /v1/http-methods.min.json
- CSV 1.3 KB
/v1/http-methods.csv
- TypeScript 2.8 KB
/v1/http-methods.ts
export const httpMethods
type HttpMethod = (typeof httpMethods)[number]
Schema
Each record in the dataset has the following shape.
| Field | Type | Description | Example |
|---|---|---|---|
| method | string | Method name (uppercase) | GET |
| safe | boolean | Does not alter server state | true |
| idempotent | boolean | Repeating the request has the same effect as making it once | true |
| cacheable | boolean | Responses may be cached | true |
| requestBody | boolean | Typically carries a request body | false |
| description | string | What the method does | Requests a representation of the target resource. |
| standard | string | Defining specification | RFC 9110 |
Preview
First 10 records.
| method | safe | idempotent | cacheable | requestBody | description |
|---|---|---|---|---|---|
| GET | true | true | true | false | Requests a representation of the target resource. The primary retrieval method; must not have side effects. |
| HEAD | true | true | true | false | Identical to GET but the server returns only headers, no body. Used to check resource metadata. |
| POST | false | false | false | true | Submits data to the resource for processing, often creating a new subordinate resource. |
| PUT | false | true | false | true | Replaces the target resource with the request payload, or creates it if absent. |
| DELETE | false | true | false | false | Removes the target resource. |
| CONNECT | false | false | false | false | Establishes a tunnel to the server identified by the target resource, typically for HTTPS through a proxy. |
| OPTIONS | true | true | false | false | Describes the communication options for the target resource; used by CORS preflight requests. |
| TRACE | true | true | false | false | Performs a message loop-back test along the path to the target resource, echoing the request. |
| PATCH | false | false | false | true | Applies a partial set of modifications to the target resource. |
| QUERY | true | true | true | true | Safe, idempotent request whose body describes a query to run against the target resource; like GET but with the query in the request content. |
Fetch examples
Drop-in snippets in five languages.
curl -sSL https://staticdata.dev/v1/http-methods.json | jq '.[0]' import type { HttpMethod } from "https://staticdata.dev/v1/http-methods.ts";
const res = await fetch("https://staticdata.dev/v1/http-methods.min.json");
if (!res.ok) throw new Error(`Fetch failed: ${res.status}`);
const httpMethods: HttpMethod[] = await res.json();
console.log(httpMethods[0]); import urllib.request, json
with urllib.request.urlopen("https://staticdata.dev/v1/http-methods.min.json") as r:
httpMethods = json.load(r)
print(httpMethods[0]) package main
import (
"encoding/json"
"fmt"
"net/http"
)
func main() {
resp, err := http.Get("https://staticdata.dev/v1/http-methods.min.json")
if err != nil { panic(err) }
defer resp.Body.Close()
var data []map[string]any
if err := json.NewDecoder(resp.Body).Decode(&data); err != nil {
panic(err)
}
fmt.Println(data[0])
} use serde_json::Value;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let body = ureq::get("https://staticdata.dev/v1/http-methods.min.json").call()?.into_string()?;
let data: Vec<Value> = serde_json::from_str(&body)?;
println!("{:?}", data.first());
Ok(())
} Sources and methodology
The eight core methods are defined by RFC 9110; PATCH is defined separately by RFC 5789, and QUERY (a safe, idempotent method that carries its query in the request body) by RFC 10008. Other methods in the IANA HTTP Method Registry, mostly WebDAV extensions such as PROPFIND and MKCOL, are not included. The boolean properties follow the RFC definitions exactly.
safe methods are read-only by contract — they should not change server state. All safe methods are also idempotent. idempotent means issuing the request N times has the same server effect as issuing it once: PUT and DELETE qualify even though they modify state, while POST and PATCH do not. cacheable reflects whether responses are cacheable by default; in practice only GET and HEAD are widely cached (POST responses can be cached only with explicit freshness information, so it is recorded as false). requestBody indicates whether a body is part of the method’s normal semantics — POST, PUT, PATCH, and QUERY carry one; sending a body on GET or DELETE has no defined meaning and is best avoided.
Versioning
URLs under /v1/ are stable: field names and types will not change in a way
that breaks consumers. Values can be corrected or records added when the upstream source
changes; schema-incompatible updates ship under a new version path. See the
http-methods changelog for this dataset's history.
Related datasets
More Web datasets
- aria-attributes
- aria-roles
- character-encodings
- csp-directives
- credit-card-types
- dns-record-types
- dom-events
- emoji
- emoji-shortcodes
- html-elements
- html-entities
- html-attributes
- input-types
- http-auth-schemes
- http-cache-directives
- http-content-codings
- http-versions
- iframe-sandbox-tokens
- ip-protocol-numbers
- keyboard-event-codes
- link-relations
- media-type-suffixes
- mime-types
- oauth-grant-types
- ports
- referrer-policies
- ip-special-blocks
- svg-elements
- tcp-flags
- tlds
- tls-cipher-suites
- tls-versions
- uri-schemes
- well-known-uris