Symfony ile Gelişmiş API Mimarisi

Post on 10-Apr-2017

853 views 3 download

Transcript of Symfony ile Gelişmiş API Mimarisi

Symfony ile Gelişmiş API Mimarisi

API

● Application Programming Interface

● REST

● Facebook/Twitter.. API

● Postman

● Swagger

● RESTful API

● JSON and XML

● Versioning

Symfony Bundles

● FOSRestBundle

● NelmioApiDocBundle

https://github.com/FriendsOfSymfony/FOSRestBundlehttps://github.com/nelmio/NelmioApiDocBundle

API Methods

● GET

● POST

● PUT

● PATCH

● DELETE

https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html

GET

● Değişikliğe neden olmamalı

● Cache Kullanılabilir

● Resource veya Resource Collection dönmeli

● Offset ve Limit olmalı (Collection için)

https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.3

POST

● Resource create

● Validation

● Hata veya resource location dönmeli

https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.5

PUT

● Create resource if not exists

● Validation

● Eğer resource varsa güncellemeli

● Yoksa resource u oluşturmalı

https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.6

PATCH

● Resource yoksa 404 dönmeli

● Validation

● Resource un belirli fieldları güncellenebilir

https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.6

DELETE● Resource yoksa 404

dönmeli

● Resource varsa silinmeli

● NULL content dönmeli

https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.7

Security● ACL

● ApiKey Auth

Teşekkürlerbehramcelen@gmail.com