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
No authentication requiredFree to use with no key needed.
Sample Requests
GET
Echo GET request
Echo back your GET request headers and params.
https://httpbin.org/get?test=value
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));
POST
Test POST
Echo back your POST request body and headers.
https://httpbin.org/post
Hover any highlighted part to learn what it does
Headers — extra info sent with the request
| Content-Type | application/json |
Request Body — data you're sending
{
"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));
GET
Simulate delay
Simulate a 2-second server delay. Useful for timeout testing.
https://httpbin.org/delay/2
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