voop / restfull-api
Тестовое restfull api
v0.0.1
2019-10-22 08:56 UTC
Requires
- doctrine/migrations: ^2.1
- doctrine/orm: ^2.6
- league/container: ^3.3
- php-curl-class/php-curl-class: ^8.6
- ramsey/uuid: ^3.8
- symfony/http-foundation: 2.5.*
- symfony/http-kernel: 2.5.*
- symfony/routing: ^4.3
- symfony/yaml: ^4.3
Requires (Dev)
- phpunit/phpunit: ^6.0
- squizlabs/php_codesniffer: ^3.3.0
This package is not auto-updated.
Last update: 2025-04-03 09:15:31 UTC
README
Сырой тестовый шаблон-заготовка restfull-АПИ без фремворка.
Создать список товаров:
curl -X PUT http://api.site/api/v1/productlist
Получить список товаров:
curl -X PUT http://api.site/api/v1/productlist
Создать заказ (со списком товаров):
curl -X PUT http://api.site/api/v1/order -H 'Content-Type: application/json' -H 'cache-control: no-cache' -d '{
"product_ids": [
"18f422d7-09b5-49ce-a596-7297e2466b6c",
"c902169a-f7b5-4253-9b93-488be65c00b8",
"d779ceed-f8b0-40b1-90ce-e1897f6d95a3"
]}'
Оплата заказа:
curl -X POST http://api.site/api/v1/orderpay -H 'Content-Type: application/json' -H 'cache-control: no-cache' -d '
{"order_id": "d779ceed-f8b0-40b1-90ce-e1897f6d95a3", "sum": 123}'