Files
Baradb/docs/fa/api-http.md

931 B

HTTP/REST API

API REST مبتنی بر JSON برای برنامه‌های وب.

Base URL

http://localhost:9470/api

Endpoints

GET /api/users

لیست همه کاربران:

curl http://localhost:9470/api/users

GET /api/users/:id

دریافت کاربر با ID:

curl http://localhost:9470/api/users/1

POST /api/users

ایجاد کاربر:

curl -X POST http://localhost:9470/api/users \
  -d '{"name": "Charlie", "age": 35}'

PUT /api/users/:id

به‌روزرسانی کاربر:

curl -X PUT http://localhost:9470/api/users/1 \
  -d '{"name": "Alice", "age": 31}'

DELETE /api/users/:id

حذف کاربر:

curl -X DELETE http://localhost:9470/api/users/1

Query Endpoint

اجرای کوئری BaraQL:

curl -X POST http://localhost:9470/api/query \
  -d '{"sql": "SELECT * FROM users WHERE age > 18"}'