json-post-request.http
@baseUrl = https://api.example.com
### Create an order with a JSON body
POST {{baseUrl}}/orders
Accept: application/json
Content-Type: application/json
{
"customerId": 42,
"items": [
{
"sku": "KARVE-001",
"quantity": 1
}
],
"notes": "Leave at reception"
}
Variables to replace
- baseUrl
- The API origin. Replace the placeholder before running the request.
Expected response
A create endpoint commonly returns 201 Created with the saved order and its ID. Validation failures generally return 400 Bad Request with field-level details.
Related examples and guides
Learn the full syntax in the .http file format guide, manage secrets with variables and environments, or see how to run .http files on Windows.
Launch Summer Sale
Run this request without leaving Windows.
Karve opens .http files as a native workspace: edit the plain text, press Run, inspect the response, and keep the file in Git.
15-day free trial · No account · No subscription · No metered requests
25% off until Sep 1