API Mock Builder
JSON cevabi yapistirin, method ve status belirleyin, sonra frontend, dokumantasyon ve local mock akisi icin kopyalanabilir ciktilar alin.
Status
200
Mock yanitinin donusu.
Header
2
Geri donecek header satiri.
Body sekli
object
3 fields
Mock editoru
Method, path, header ve JSON body gir; sonra ayni mock'tan curl, fetch, TypeScript ve OpenAPI ciktisi al.
Mock payload
Bu obje mock servise veya local fixture dosyasina dogrudan koyulabilir.
{
"status": 200,
"delayMs": 0,
"headers": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Cache-Control",
"value": "no-store"
}
],
"body": {
"id": "evt_42",
"status": "ok",
"data": {
"project": "uxTools",
"features": [
"json",
"regex",
"discord"
]
}
}
}Fetch ornegi
Frontend testlerinde ayni sekli hizla canlandirmak icin.
fetch("/api/projects/42", {
method: "GET",
headers: {
"Content-Type": "application/json",
"Cache-Control": "no-store"
},
});cURL ornegi
Dokumantasyon veya Postman import akisi icin.
curl -X GET "https://example.com/api/projects/42" \
-H "Content-Type: application/json" \
-H "Cache-Control: no-store"TypeScript type
Response seklinden cikarilan hizli tip taslagi.
type MockResponse = {
id: string;
status: string;
data: {
project: string;
features: string[];
};
};OpenAPI snippet
Swagger dosyasina tasiyabilecegin minimal response tanimi.
/api/projects/42:
get:
summary: Mock endpoint
responses:
"200":
description: Mock response
headers:
Content-Type:
schema:
type: string
example: "application/json"
Cache-Control:
schema:
type: string
example: "no-store"
content:
application/json:
schema:
type: object
properties:
id:
type: string
status:
type: string
data:
type: object
properties:
project:
type: string
features:
type: array
items:
type: string