Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. HTTP
  3. Reference
  4. HTTP response status codes
  5. 202 Accepted

202 Accepted

The HTTP202 Acceptedsuccessful response status code indicates that a request has been accepted for processing, but processing has not been completed or may not have started.The actual processing of the request is not guaranteed; a task or action may fail or be disallowed when a server tries to process it.

A202 response is non-committal, meaning there is no way to later send an asynchronous HTTP response to indicate the outcome of the processing.This response code is typically used when the request is handled by another process or server, or when requests are processed in batches.

Status

http
202 Accepted

Examples

Begin automated task

In the following example, we want to kick off an automation process to email dog owners about a pickup task:

http
POST /tasks HTTP/1.1Host: example.comContent-Type: application/json{  "task": "emailDogOwners",  "template": "pickup"}

The response indicates that the request to start a task was accepted for processing.A URL is sent in the response body so the client can track changes to the status of the task:

http
HTTP/1.1 202 AcceptedDate: Wed, 26 Jun 2024 12:00:00 GMTServer: Apache/2.4.1 (Unix)Content-Type: application/json{  "message": "Request accepted. Starting to process task.",  "taskId": "123",  "monitorUrl": "http://example.com/tasks/123/status"}

Specifications

Specification
HTTP Semantics
# status.202

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp