Skip to main content
Dev · 283 tools

Mock HTTP Request Generator

Generates example raw HTTP requests for testing and learning

HTTP RequestExample — click Generate for yours
Host
api.example.com
User-Agent
curl/8.4.0
Accept
application/json
Authorization
Bearer HgPDJQ1a0gg7uKtwqM5uDCchC
X-Request-ID
8267a420-c70d-4cd4-bd85-109117c9f4db
Content-Type
application/json
Content-Length
76

Generated 19 words · 322 characters

See 3 examples
  • Example 1
    POST /api/orders HTTP/1.1
    Host: api.example.com
    User-Agent: curl/8.4.0
    Accept: application/json
    Authorization: Bearer HgPDJQ1a0gg7uKtwqM5uDCchC
    X-Request-ID: 8267a420-c70d-4cd4-bd85-109117c9f4db
    Content-Type: application/json
    Content-Length: 76
    
    {"customer_id":10298,"items":[{"sku":"SKU-96027","qty":2}],"currency":"USD"}
  • Example 2
    DELETE /api/invoices/INV-8442 HTTP/1.1
    Host: api.example.com
    User-Agent: curl/8.4.0
    Accept: application/json
    Authorization: Bearer t5DssRV5YVu2bj4DyRnIHPRPLRygUkgZWxWQG
    X-Request-ID: f39ab461-0fbd-45be-9b1f-f8484e44b365
  • Example 3
    POST /api/logout HTTP/1.1
    Host: api.example.com
    User-Agent: curl/8.4.0
    Accept: application/json
    Authorization: Bearer mSVaCU9gxXVmCRdvaTOvP8zBZvZPckiWoO
    X-Request-ID: 38544006-0bea-45ec-b19d-f3d84d399ee4
    Content-Type: application/json
    Content-Length: 21
    
    {"all_devices":false}

About this generator

Every HTTP client call, curl command, and fetch() call eventually becomes a raw request on the wire — a method and path, headers, and an optional body. Seeing that raw format demystifies debugging and makes it clear why the Host header is required, why POST bodies need a Content-Type, and why GET requests have no body. This tool generates a sample raw HTTP request with no inputs required. The output randomizes the method (GET, POST, PUT, PATCH, DELETE) and the path across 26 realistic API routes — users, orders, products, projects and tasks, comments, carts, webhooks, sessions, reports and more — with random IDs and query strings such as /api/orders/48213 or /api/products?page=3&sort=-price. Each route only uses methods that make sense for it, so you never see a PATCH to a login endpoint. Every request includes the request line, Host, User-Agent (curl/8.4.0), Accept, a random Bearer token in the Authorization header (except on login), and a unique X-Request-ID. POST, PUT, and PATCH requests add Content-Type: application/json, a Content-Length computed from the body, a blank separator line, and a JSON body that fits the route — a new user with a name and email, an order with line items, a status change, and so on. Copy the output into documentation, a test fixture, or a learning exercise. Understanding this wire format makes tools like curl, Postman, and HTTP proxies far less opaque when you are debugging an API that is not behaving as expected.

How to use

  1. Click Generate to produce an HTTP request.
  2. Copy it into a test or doc.
  3. Adapt the method, path, and body.
  4. Use it to understand the wire format.

Use Cases

  • •Learning the raw HTTP format
  • •Testing an HTTP parser
  • •Documenting an API request
  • •Demoing how requests work
  • •Debugging API calls

Tips

  • →The method signals intent.
  • →POST and PUT carry a body.
  • →Headers carry request metadata.
  • →The raw format demystifies curl.

FAQ

what does the generated http request include

A request line (METHOD PATH HTTP/1.1), then Host, User-Agent, Accept, an Authorization: Bearer header with a random token (left off login requests), and an X-Request-ID. For POST, PUT, and PATCH it also adds Content-Type: application/json, a Content-Length, a blank line separator, and a JSON body that matches the route.

why do get and delete requests have no body

By convention and the HTTP specification, GET and DELETE convey their intent entirely through the request line and headers — the URL identifies the resource and the method says what to do with it. POST, PUT, and PATCH need a body to carry the data being created or updated. The generated requests follow this convention.

why is the blank line between headers and body important

HTTP message format uses a blank line (CRLF after the last header) to signal the end of the headers and the start of the body. Parsers rely on this delimiter — a missing blank line means the parser cannot find the body, and an extra blank line in the headers terminates them early. The generated requests include this separator correctly.

can I send this request directly to a server

Not directly from this tool. The output is the raw text of an HTTP request for learning and documentation. To send a real request, use curl with the -X and -H flags, or a tool like httpie. The generated text gives you the exact headers and body to specify in those tools.

You might also like

Popular tools from other categories that share themes with this one.