202

Accepted

2xx Success The request has been accepted for processing, but processing is not complete

Code Examples

Here are examples of how to test HTTP 202 responses in different programming languages:

Select options below to see how to use advanced features in your code:

Request:
curl https://free.mockerapi.com/202
Response Body:
{
  "success": true,
  "status": 202,
  "statusText": "Accepted - The request has been accepted for processing, but processing is not complete",
  "timestamp": "2025-10-08T10:30:45.123Z",
  "request": {
    "method": "GET",
    "url": "/202",
    "fullUrl": "https://free.mockerapi.com/202"
  }
}
Request:
fetch('https://free.mockerapi.com/202')
  .then(response => {
    console.log('Status:', response.status); // 202
    return response.json();
  })
  .then(data => {
    console.log('Success:', data);
  })
  .catch(error => {
    console.error('Error:', error);
  });
Response Body:
{
  "success": true,
  "status": 202,
  "statusText": "Accepted - The request has been accepted for processing, but processing is not complete",
  "timestamp": "2025-10-08T10:30:45.123Z",
  "request": {
    "method": "GET",
    "url": "/202",
    "fullUrl": "https://free.mockerapi.com/202"
  }
}
Request:
import requests

response = requests.get('https://free.mockerapi.com/202')

print(f'Status Code: {response.status_code}')  # 202
print(f'Response: {response.json()}')
Response Body:
{
  "success": true,
  "status": 202,
  "statusText": "Accepted - The request has been accepted for processing, but processing is not complete",
  "timestamp": "2025-10-08T10:30:45.123Z",
  "request": {
    "method": "GET",
    "url": "/202",
    "fullUrl": "https://free.mockerapi.com/202"
  }
}
Request:
Response Body:
{
  "success": true,
  "status": 202,
  "statusText": "Accepted - The request has been accepted for processing, but processing is not complete",
  "timestamp": "2025-10-08T10:30:45.123Z",
  "request": {
    "method": "GET",
    "url": "/202",
    "fullUrl": "https://free.mockerapi.com/202"
  }
}
Request:
require 'net/http'
require 'json'

uri = URI('https://free.mockerapi.com/202')
response = Net::HTTP.get_response(uri)

puts "Status Code: #{response.code}"  # 202
puts "Response: #{JSON.parse(response.body)}"
Response Body:
{
  "success": true,
  "status": 202,
  "statusText": "Accepted - The request has been accepted for processing, but processing is not complete",
  "timestamp": "2025-10-08T10:30:45.123Z",
  "request": {
    "method": "GET",
    "url": "/202",
    "fullUrl": "https://free.mockerapi.com/202"
  }
}
Request:
package main

import (
    "fmt"
    "io"
    "net/http"
)

func main() {
    resp, err := http.Get("https://free.mockerapi.com/202")
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    fmt.Printf("Status Code: %d\n", resp.StatusCode)  // 202

    body, err := io.ReadAll(resp.Body)
    if err != nil {
        panic(err)
    }

    fmt.Printf("Response: %s\n", body)
}
Response Body:
{
  "success": true,
  "status": 202,
  "statusText": "Accepted - The request has been accepted for processing, but processing is not complete",
  "timestamp": "2025-10-08T10:30:45.123Z",
  "request": {
    "method": "GET",
    "url": "/202",
    "fullUrl": "https://free.mockerapi.com/202"
  }
}
Request:
import java.net.http.*;
import java.net.URI;

public class HttpStatusTest {
    public static void main(String[] args) throws Exception {
        HttpClient client = HttpClient.newHttpClient();
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://free.mockerapi.com/202"))
            .GET()
            .build();

        HttpResponse response = client.send(request,
            HttpResponse.BodyHandlers.ofString());

        System.out.println("Status Code: " + response.statusCode());  // 202
        System.out.println("Response: " + response.body());
    }
}
Response Body:
{
  "success": true,
  "status": 202,
  "statusText": "Accepted - The request has been accepted for processing, but processing is not complete",
  "timestamp": "2025-10-08T10:30:45.123Z",
  "request": {
    "method": "GET",
    "url": "/202",
    "fullUrl": "https://free.mockerapi.com/202"
  }
}
Request:
const https = require('https');

https.get('https://free.mockerapi.com/202', (res) => {
  console.log('Status Code:', res.statusCode);  // 202

  let data = '';

  res.on('data', (chunk) => {
    data += chunk;
  });

  res.on('end', () => {
    console.log('Response:', JSON.parse(data));
  });
}).on('error', (err) => {
  console.error('Error:', err.message);
});
Response Body:
{
  "success": true,
  "status": 202,
  "statusText": "Accepted - The request has been accepted for processing, but processing is not complete",
  "timestamp": "2025-10-08T10:30:45.123Z",
  "request": {
    "method": "GET",
    "url": "/202",
    "fullUrl": "https://free.mockerapi.com/202"
  }
}

What is HTTP 202 Accepted?

HTTP 202 Accepted indicates that the request has been accepted for processing, but the processing has not been completed. The request might or might not eventually be acted upon, as it might be disallowed when processing actually takes place. This is commonly used for asynchronous processing.

  • Asynchronous Processing: The request is queued for processing but not yet complete
  • No Guarantee: Acceptance doesn't guarantee the request will succeed
  • Background Jobs: Often used for long-running operations moved to background
  • Status Location: May include information about where to check processing status

When Does This Happen?

A 202 Accepted response is returned when the server accepts a request for processing but hasn't completed it yet. This is useful for operations that take time to complete. You'll see this status code when:

  • Submitting a batch job or long-running task to be processed asynchronously
  • Uploading large files that require processing or validation
  • Triggering data imports or exports that happen in the background
  • Submitting requests that require manual review or approval
  • Queueing tasks for processing by worker processes

Try It Live

Click the button below to make a live request and see the 202 Accepted response

Common Use Cases

⏱️ Async Processing Testing

Test how your application handles asynchronous operations and background job submissions.

🔄 Queue Management

Mock accepted responses for task queue systems without actual background processing.

🎨 UI Status Indicators

Develop and test loading states, progress indicators, and status polling for long-running operations.

📤 Batch Operations

Simulate batch upload or import operations that are processed asynchronously.

📝 Webhook Testing

Test webhook endpoints that accept requests and process them in the background.

🔍 Status Polling

Develop status checking logic for operations that return 202 and require polling.

Related Success Status Codes