Download presentation
Presentation is loading. Please wait.
Published byあかり あさま Modified over 6 years ago
3
Urnik 09.00 – 10.30 REST JSON odjemalci 10.30 – 11.00 odmor
11.00 – 12.30 avtentikacija strežniki orodja
4
Songsterr
5
REpresentational State Transfer
arhitektura www prenosni medij = http ukazi = http ukazi podatki = URL + http telo [json,xml] kontrolne informacije = http header napake = http status
6
CRUD REST SQL Create POST [PUT] INSERT Read GET SELECT Update
PUT [PATCH] UPDATE Delete DELETE
7
Podatki URL fizični strežnik + REST strežnik [API] + resource + parametri /a/ra/ songs/byartists.json ?artists=Queen ID je lahko del sredstva
8
Http standardi Upoštevanje statusov
301 => preusmeritev Upoštevanje standardov [http headerji] Vmesni pomnilniki (cache proxy) Tip podatkov (accept, content-type) Nabor znakov (accept-charset)
9
Zakaj REST? Enostavna implementacija Berljivost
http nivo obstaja povsod IoT JavaScript Berljivost Izraba spletne infrastructure Strežniki, proxy strežniki, firewalli Razširjenost strežnikov Facebook, Twitter, Google, Amazon, Dropbox …
10
Hypermedia as the Engine of Application State
GET /account/12345 <?xml version="1.0"?> <account> <account_number>12345</account_number> <balance currency="usd">100.00</balance> <link rel="deposit" href=" /> <link rel="withdraw" href=" /> <link rel="transfer" href=" /> <link rel="close" href=" /> </account>
11
Hypermedia as the Engine of Application State
GET /account/12345 <?xml version="1.0"?> <account> <account_number>12345</account_number> <balance currency="usd">-25.00</balance> <link rel="deposit" href=" /> </account>
12
JavaScript Object Notation
key:value, key:value, …. key:value { "person" : { "id" : 123, "name" : "Alice", "age" : Null, "friends" : [42, 177, 13] } }
13
JSON in Delphi System.JSON [XE6] REST.Json [XE6]
TJSONValue, TJSONObject, … REST.Json [XE6] Tjson.ObjectToJsonString TJson.JsonToObject
14
Odjemalci http REST Client Library [XE5] DataSnap
ICS, Indy, WinINet, System.Net.HttpClient REST Client Library [XE5] REST.Client, REST.HttpClient, REST.Authenticator.* … DataSnap TDSRESTConnection [D10] System.Net.HttpClient
15
JSON → DataSet TRESTResponseDatasetAdapter
16
Avtentikacija Simple [TSimpleAuthenticator]
GET/POST, nešifrirano Basic [THTTPBasicAuthenticator] RFC2617 Header, BASE64 OAuth 1.0a [TOAuth1Authenticator] gesla se ne prenašajo zastarel OAuth2 [TOAuth2Authenticator] večina »velikih« (Facebook, Google …)
17
OAuth2 odjemalec http spletni strežnik Resource Owner Authorization
An Overview of OAuth2 using the REST Client Components odjemalec http spletni strežnik 1) Authorization Request Resource Owner 2) Authorization Grant 3) Authorization Grant Authorization Server 4) Access Token 5) Access Token Resource Server 6) Protected Resource
18
Strežniki DataSnap www Indy, ICS ORM mORMot
19
DataSnap XE Enterprise+ Win32/64 VCL/FireMonkey Odjemalci
RAD Studio: Win32/64, OS X/32, iOS, Android Proxy: Android, BlackBerry, iOS, Windows Phone JavaScript: brskalniki, naprave REST: karkoli
20
DataSet → JSON TDataSetRESTRequestAdapter
github: andrea-magni/TDataSetRESTRequestAdapter
21
Orodja REST Debugger XE5, source Postman Chrome Fiddler .NET 2/4
22
Vprašanja?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.