httpbin
httpbin.org · Developer Tools
HTTP request/response testing service — test your HTTP client with endpoints that echo requests, simulate delays, return specific status codes, and handle auth flows. No API key.
Authentication
Sample Requests
Echo back your GET request headers and params.
Hover any highlighted part to learn what it does
curl -X GET "https://httpbin.org/get?test=value"
import requests
params = {
"test": "value"
}
response = requests.get(
"https://httpbin.org/get",
params=params,
)
print(response.json())const url = new URL('https://httpbin.org/get');
url.searchParams.set('test', 'value');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://httpbin.org/get")
q := baseURL.Query()
q.Set("test", "value")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://httpbin.org/get")
uri.query = URI.encode_www_form({
"test" => "value"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://httpbin.org/get?" . http_build_query([
"test" => "value"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Echo back your POST request body and headers.
Hover any highlighted part to learn what it does
| Content-Type | application/json |
{
"key": "value"
}
curl -X POST "https://httpbin.org/post" \
-H "Content-Type: application/json" \
-H "Content-Type: application/json" \
-d '{"key":"value"}'import requests
headers = {
"Content-Type": "application/json"
}
data = {
"key": "value"
}
response = requests.post(
"https://httpbin.org/post",
headers=headers,
json=data,
)
print(response.json())const url = 'https://httpbin.org/post';
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
"key": "value"
}),
});
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"bytes"
"encoding/json"
)
func main() {
targetURL := "https://httpbin.org/post"
jsonData, _ := json.Marshal({"key":"value"})
req, _ := http.NewRequest("POST", targetURL, bytes.NewBuffer(jsonData))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://httpbin.org/post")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Post.new(uri)
req["Content-Type"] = "application/json"
req["Content-Type"] = "application/json"
req.body = "{\"key\":\"value\"}"
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://httpbin.org/post";
$opts = ["http" => [
"method" => "POST",
"header" => implode("\r\n", [
"Content-Type: application/json",
"Content-Type: application/json"
]),
"content" => json_encode({"key":"value"}),
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Simulate a 2-second server delay. Useful for timeout testing.
Hover any highlighted part to learn what it does
curl -X GET "https://httpbin.org/delay/2"
import requests
response = requests.get(
"https://httpbin.org/delay/2",
)
print(response.json())const url = 'https://httpbin.org/delay/2'; const response = await fetch(url); const data = await response.json(); console.log(data);
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
targetURL := "https://httpbin.org/delay/2"
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://httpbin.org/delay/2")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://httpbin.org/delay/2";
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- No API key needed
- Echo GET: GET https://httpbin.org/get
- Echo POST: POST https://httpbin.org/post with any body
- Status codes: GET https://httpbin.org/status/404
- Delay: GET https://httpbin.org/delay/3 (3 second delay)
- Auth: GET https://httpbin.org/basic-auth/user/pass with Basic auth
What can you build with httpbin?
httpbin is a Developer Tools API. Developers commonly use developer tools APIs for:
- automating code review and quality checks
- integrating CI/CD pipelines and build systems
- managing feature flags and A/B tests
- monitoring errors and application performance
- generating and validating test data
No authentication required. This API is open — no signup or key needed. Ideal for quick prototypes and public-facing features. httpbin is free to use, making it a low-risk choice to experiment with.
New to APIs? Read our beginner's guide