🛠️ToolsShed

HTTP 方法参考

HTTP 方法完整指南 — GET、POST、PUT、DELETE、PATCH 等。

GET安全: 幂等:

Retrieves a resource without modifying server state. The most commonly used HTTP method.

使用场景: Fetching a webpage, API data, or file.

POST安全: 幂等:

Submits data to the server to create a new resource or trigger a process.

使用场景: Form submission, creating a new record via API.

PUT安全: 幂等:

Replaces the entire target resource with the request payload.

使用场景: Updating a user profile — replaces all fields.

PATCH安全: 幂等:

Partially modifies a resource — only sends the fields that need updating.

使用场景: Updating only the email of a user record.

DELETE安全: 幂等:

Removes the target resource from the server.

使用场景: Deleting a blog post or API record.

HEAD安全: 幂等:

Same as GET but returns only headers, not the response body.

使用场景: Checking if a URL exists or getting Content-Length.

OPTIONS安全: 幂等:

Describes the communication options for the target resource. Used in CORS preflight.

使用场景: CORS preflight requests.

TRACE安全: 幂等:

Performs a message loop-back test along the path to the target resource.

使用场景: Debugging proxy chains (rarely used, often disabled).

CONNECT安全: 幂等:

Establishes a tunnel to the server identified by the target resource.

使用场景: HTTPS tunneling through HTTP proxies.

Comments & Feedback

Comments are powered by Giscus. Sign in with GitHub to leave a comment.