Code Examples
Here are examples of how to test HTTP 418 responses in different programming languages:
Select options below to see how to use advanced features in your code:
curl https://free.mockerapi.com/418
{ "success": false, "status": 418, "statusText": "I'm a teapot", "timestamp": "2025-10-08T10:30:45.123Z", "request": { "method": "GET", "url": "/418", "fullUrl": "https://free.mockerapi.com/418" } }
fetch('https://free.mockerapi.com/418') .then(response => { console.log('Status:', response.status); // 418 return response.json(); }) .then(data => { console.log('Response:', data); }) .catch(error => { console.error('Error:', error); });
{ "success": false, "status": 418, "statusText": "I'm a teapot", "timestamp": "2025-10-08T10:30:45.123Z", "request": { "method": "GET", "url": "/418", "fullUrl": "https://free.mockerapi.com/418" } }
import requests response = requests.get('https://free.mockerapi.com/418') print(f'Status Code: {response.status_code}') # 418 print(f'Response: {response.json()}')
{ "success": false, "status": 418, "statusText": "I'm a teapot", "timestamp": "2025-10-08T10:30:45.123Z", "request": { "method": "GET", "url": "/418", "fullUrl": "https://free.mockerapi.com/418" } }
{ "success": false, "status": 418, "statusText": "I'm a teapot", "timestamp": "2025-10-08T10:30:45.123Z", "request": { "method": "GET", "url": "/418", "fullUrl": "https://free.mockerapi.com/418" } }
require 'net/http' require 'json' uri = URI('https://free.mockerapi.com/418') response = Net::HTTP.get_response(uri) puts "Status Code: #{response.code}" # 418 puts "Response: #{JSON.parse(response.body)}"
{ "success": false, "status": 418, "statusText": "I'm a teapot", "timestamp": "2025-10-08T10:30:45.123Z", "request": { "method": "GET", "url": "/418", "fullUrl": "https://free.mockerapi.com/418" } }
package main import ( "fmt" "io" "net/http" ) func main() { resp, err := http.Get("https://free.mockerapi.com/418") if err != nil { panic(err) } defer resp.Body.Close() fmt.Printf("Status Code: %d\n", resp.StatusCode) // 418 body, err := io.ReadAll(resp.Body) if err != nil { panic(err) } fmt.Printf("Response: %s\n", body) }
{ "success": false, "status": 418, "statusText": "I'm a teapot", "timestamp": "2025-10-08T10:30:45.123Z", "request": { "method": "GET", "url": "/418", "fullUrl": "https://free.mockerapi.com/418" } }
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/418")) .GET() .build(); HttpResponseresponse = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println("Status Code: " + response.statusCode()); // 418 System.out.println("Response: " + response.body()); } }
{ "success": false, "status": 418, "statusText": "I'm a teapot", "timestamp": "2025-10-08T10:30:45.123Z", "request": { "method": "GET", "url": "/418", "fullUrl": "https://free.mockerapi.com/418" } }
const https = require('https'); https.get('https://free.mockerapi.com/418', (res) => { console.log('Status Code:', res.statusCode); // 418 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); });
{ "success": false, "status": 418, "statusText": "I'm a teapot", "timestamp": "2025-10-08T10:30:45.123Z", "request": { "method": "GET", "url": "/418", "fullUrl": "https://free.mockerapi.com/418" } }
What is HTTP 418 I'm a teapot?
HTTP 418 I'm a teapot is a humorous HTTP status code defined in RFC 2324 (Hyper Text Coffee Pot Control Protocol) as an April Fools' joke in 1998. The server refuses the attempt to brew coffee with a teapot, indicating that it's a teapot, not a coffee pot.
While originally a joke, this status code has been implemented by some servers and is sometimes used as a playful easter egg or to signal certain server configurations. It's not intended for serious use in production applications.
When Does This Happen?
A 418 I'm a teapot response is rarely encountered in real-world scenarios but may appear in:
- Easter eggs in web applications and APIs
- Testing and mock API services (like this one)
- Playful responses in developer-friendly services
- Educational demonstrations of HTTP status codes
- Some servers use it as a signal for blocking automated requests
Try It Live
Click the button below to make a live request and see the 418 I'm a teapot response
Common Use Cases
๐งช API Testing
Test how your application handles unusual or non-standard HTTP status codes.
๐ญ Easter Eggs
Implement fun easter eggs in your API for developers to discover.
๐ Educational Purposes
Demonstrate the full range of HTTP status codes including humorous ones.
๐ Mock Services
Provide comprehensive mock responses for testing client applications.
๐จ Creative Responses
Use as a playful response for specific edge cases or special endpoints.
๐ค Bot Detection
Some services use this status code to signal automated request blocking.