Hello, World!
-
Prepare file
dump.txt:
```httpx
GET /api/customer/123 HTTP/1.1
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": 123,
"fname": "John",
"lname": "Doe",
"email": ["john@example.com", "johndoe@example.com"]
}
```
-
Start server:
```
java -jar df.jar --dump dump.txt
```
-
Navigate to:
http://localhost:8080/api/customer/123
-
Get response:
```json
{
"id": 123,
"fname": "John",
"lname": "Doe",
"email": ["john@example.com", "johndoe@example.com"]
}
```
⚡️ Hacks and Tips:
- DeepfakeHTTP also supports
HEAD, POST, PUT, DELETE etc. methods
- Don't miss a single carriage return between headers and body!
💡 See Also:
|