Eve - REST APIs for Humans™
This is a modal window.
The media could not be loaded, either because the server or network failed or because the format is not supported.
Formal Metadata
Title |
| |
Title of Series | ||
Part Number | 98 | |
Number of Parts | 119 | |
Author | ||
License | CC Attribution 3.0 Unported: You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor. | |
Identifiers | 10.5446/20012 (DOI) | |
Publisher | ||
Release Date | ||
Language | ||
Production Place | Berlin |
Content Metadata
Subject Area | ||
Genre | ||
Abstract |
| |
Keywords |
EuroPython 201497 / 119
1
2
9
10
11
13
15
17
22
23
24
27
28
41
44
46
49
56
78
79
80
81
84
97
98
99
101
102
104
105
107
109
110
111
112
113
116
118
119
00:00
Representational state transferGoodness of fitRepresentational state transferEqualiser (mathematics)Moment (mathematics)Duality (mathematics)Wave packetComputer animationLecture/Conference
00:43
Representational state transferWave packetEvent horizonProjective planeCodeCartesian coordinate systemRepresentational state transferOpen sourceSoftware frameworkResultantClient (computing)Software testingLine (geometry)Product (business)Metropolitan area networkLecture/Conference
01:55
Open sourceProcess (computing)WebsiteClient (computing)Representational state transferWeb 2.0Data storage deviceSoftware frameworkNormal (geometry)TheoryJSONXMLLecture/Conference
02:49
Mobile appMetropolitan area networkClassical physicsDifferent (Kate Ryan album)Core dumpSoftware frameworkCodeSocial classScripting languageSet (mathematics)Representational state transferComputer animationLecture/Conference
03:32
Rule of inferenceLarge eddy simulationCore dumpTime domainSoftware frameworkComputer filePoint (geometry)CASE <Informatik>Information securityPiRepresentational state transferXMLComputer animationLecture/Conference
04:07
Inheritance (object-oriented programming)Link (knot theory)Client (computing)Instance (computer science)PasswordEmailData typeLengthUniqueness quantificationRegulärer Ausdruck <Textverarbeitung>Address spaceString (computer science)Rule of inferenceTime domainSummierbarkeitWritingPatch (Unix)Default (computer science)Artificial neural networkCache (computing)Field (computer science)Control flowComputer configurationPerformance appraisalPrincipal ideal domainCASE <Informatik>Event horizonSet (mathematics)Point (geometry)Type theoryDatabaseMathematical analysisField (computer science)Client (computing)Link (knot theory)Software maintenanceConnected spaceElectric generatorMultiplication signKey (cryptography)AdditionCommitment schemeSpherical capProduct (business)Active contour modelView (database)Maxima and minimaData dictionaryLine (geometry)LengthMeta elementData typeHidden Markov modelRegulärer Ausdruck <Textverarbeitung>Default (computer science)Different (Kate Ryan album)Validity (statistics)Game controllerScripting languageCache (computing)Electronic mailing listRule of inferenceString (computer science)Computer animation
07:16
Digital filterDesign of experimentsMaxima and minimaWeb pageField (computer science)Axonometric projectionRippingDefault (computer science)MiniDiscGreen's functionEmbedded systemClient (computing)Filter <Stochastik>Default (computer science)Web pageProjective planeArithmetic meanHypermediaPoint (geometry)CASE <Informatik>Flow separationSoftware testingField (computer science)Key (cryptography)Mobile appSource codeOrder (biology)Different (Kate Ryan album)Endliche ModelltheorieCycle (graph theory)Maxima and minimaAuthorizationQuicksortBand matrixWebsiteAvatar (2009 film)ResultantLecture/ConferenceXMLUML
09:36
SatelliteDecimalAddress spaceComputer configurationState of matterHypermediaLink (knot theory)Inheritance (object-oriented programming)Electronic mailing listPauli exclusion principleRevision controlDefault (computer science)Field (computer science)MetreInheritance (object-oriented programming)Revision controlWeb pageHypermediaLink (knot theory)Cartesian coordinate systemAxiom of choiceState of matterVelocityWater vaporPhase transitionLevel (video gaming)Power (physics)Web 2.0Lecture/ConferenceXML
10:41
Default (computer science)Revision controlSinc functionDifferenz <Mathematik>File systemParameter (computer programming)Data storage deviceComputer fileDecision tree learningDoppler-EffektMathematical optimizationVideoconferencingLecture/Conference
11:34
Default (computer science)Computer fileData storage deviceData typeHypermediaString (computer science)Large eddy simulationContent (media)User profileComputer-generated imageryWindowBit rateLimit (category theory)Mathematical singularityClient (computing)Conditional probabilityCache (computing)DecimalSineUniform resource nameRepresentational state transferMathematicsField (computer science)Dependent and independent variablesNumberBranch (computer science)Data storage deviceComputer fileString (computer science)Bit ratePoint (geometry)Pointer (computer programming)Condition numberSoftware developerMultiplication signDemosceneFile formatSet (mathematics)SurfaceField (computer science)ResultantSoftware testingComputer configurationBasis <Mathematik>Dependent and independent variablesSampling (statistics)Performance appraisalContent (media)Information retrievalHypermediaVector spaceDifferent (Kate Ryan album)Error messageType theorySpeech synthesisMassRecursionMatching (graph theory)CASE <Informatik>Forcing (mathematics)Sheaf (mathematics)Default (computer science)Standard deviationInformationMathematicsWindowExecution unitClient (computing)Physical systemSingle-precision floating-point formatRight angleMetadataMetreStructural loadLimit (category theory)EmailInsertion lossCasting (performing arts)Validity (statistics)Endliche ModelltheorieLecture/ConferenceComputer animation
15:53
Field (computer science)SummierbarkeitDependent and independent variablesUniform resource nameConcurrency (computer science)Data integrityPatch (Unix)Server (computing)Client (computing)Multiplication signMatching (graph theory)INTEGRALGame controllerServer (computing)PreconditionerNetwork topologyClient (computing)Field (computer science)Patch (Unix)EmailRevision controlConcurrency (computer science)Meta elementError messageAmerican Physical SocietyLecture/ConferenceComputer animation
16:53
Token ringAuthorizationControl flowRevision controlClient (computing)Validity (statistics)Dependent and independent variablesServer (computing)Computing platformNetwork topologyInsertion lossPoint (geometry)WordAuthorizationError messageMultiplication signAuthenticationOpen sourceCodeLine (geometry)Token ringLecture/ConferenceXMLUML
18:10
Device driverMaxima and minimaSpecial unitary groupVarianceMountain passCAN busUltraviolet photoelectron spectroscopyException handlingComa BerenicesSocial classComputer clusterSoftware developerCodeProjective planeExtension (kinesiology)CASE <Informatik>Arithmetic progressionBranch (computer science)Lecture/ConferenceXMLUML
18:56
NumberIntegerTable (information)Social classImplementationSet (mathematics)Social classComputer filePoint (geometry)XML
19:20
Interior (topology)Mobile appPrice indexIntegerElasticity (physics)Conic sectionRaw image formatCAN busDefault (computer science)Social classSystem on a chipHexagonAuthenticationToken ringRepresentational state transferControl flowElasticity (physics)AuthenticationSampling (statistics)Game controllerInheritance (object-oriented programming)LogicINTEGRALWater vaporPoint (geometry)XMLUMLComputer animation
19:55
PasswordSocial classMobile appMountain passAmsterdam Ordnance DatumGame controllerPoint (geometry)Open setCodeMultiplication signSocial classRollenbasierte ZugriffskontrolleSequenceDependent and independent variablesStress (mechanics)CASE <Informatik>Function (mathematics)Water vaporPasswordInstance (computer science)Lecture/ConferenceJSONXMLUML
21:00
LogicGroup actionLoop (music)Event horizonPatch (Unix)Density of statesClique-widthValidity (statistics)Data typeLogicPoint (geometry)Type theoryCustomer relationship managementFunctional (mathematics)StapeldateiMultiplication signAxiom of choicePolygonPatch (Unix)Event horizonHookingTime zoneLecture/ConferenceComputer animation
22:04
HookingSinguläres IntegralEvent horizonMobile appHand fanField (computer science)Coma BerenicesNormed vector spaceField (computer science)Functional (mathematics)Fiber (mathematics)Presentation of a groupMobile WebSet (mathematics)Forcing (mathematics)Client (computing)Multiplication signSource codeHookingCategory of beingUML
22:53
Data storage deviceInstallable File SystemHypermediaHookingValue-added networkVoltmeterQuantum stateMetropolitan area networkVacuumCore dumpSmith chartInclusion mapRobotSineInstance (computer science)Social classFile systemObject-relational mappingWeb pageProjective planeExtension (kinesiology)WordDefault (computer science)Moment (mathematics)BitEndliche ModelltheorieGeometryData storage deviceCondition numberSimilarity (geometry)Product (business)Point (geometry)Source codeFood energyXMLComputer animation
24:35
Projective planeBranch (computer science)Process (computing)Open setPopulation densityWater vaporLecture/Conference
25:25
PolygonPoint (geometry)MultiplicationString (computer science)Line (geometry)Ring (mathematics)Type theoryGeometrySocial classVolumenvisualisierungLattice (order)VarianceQuery languageTouch typingProjective planeAddress spaceUniform resource locatorTwitterMathematicsTablet computerVolumenvisualisierungPoint (geometry)Validity (statistics)Repository (publishing)GeometrySource codeXML
26:17
TwitterComa BerenicesMoment (mathematics)BitCartesian coordinate systemClient (computing)Multiplication signData managementPoint (geometry)Demo (music)Graphical user interfaceMobile appRemote procedure callSampling (statistics)Lecture/Conference
27:34
Physical lawSoftware testingSource codeNumberSoftware repositoryUniform resource locatorSuite (music)Software frameworkCartesian coordinate systemAuthorizationIntrusion detection systemGoodness of fitMultiplication signBitRepresentational state transferAreaCode refactoringProjective planeRow (database)TheoryComa BerenicesSet (mathematics)Pole (complex analysis)Point (geometry)Computer animationLecture/Conference
30:38
Commodore VIC-20
Transcript: English(auto-generated)
00:15
Please welcome Nicola for his talk if REST APIs for humans. Good morning. Thank you
00:27
so first a little story to two years ago in 2012 I was at Europe I saw in Florence and there was a gave a talk about building the rest API's with flask
00:40
that was a Kind of a training a very long talk and There was a lot of interest about that project and the code that I showed back then and people were asking if We were thinking about releasing that kind of application as an open source project and so even
01:02
which is the project which that I'm going to show you today is basically the offspring of that talk and so it's very cool for me to be here again at your Python and presenting the result of that Event so rest API for humans, I guess
01:22
100% of you know that I stole this tagline from Catheterized request which is basically the client side of any Python REST API and the reason why I'm doing this is because basically the Idea behind this REST API framework is the same as request
01:43
Which is make things as simple as possible and So here it is Well, I will just keep about on this one since you already heard from my chair speaker
02:01
What I do for work for job And what is a feeling the philosophy of Eva? Basically you have some data store somewhere some data and you need the REST API to expose your data to some I don't know mobile client maybe or web website or whether what have you and what you do is just install even and
02:24
In a few hopeful hopefully in a few minutes you get working API For you it is powered by flask as I told you already MongoDB Readies for a few features and a few other things about these are the big three
02:42
Guys in town. I say so and a very quick Quick start so you get an idea of what working with this framework means How many of you are working with flask already? Oh, I have an idea. Oh, oh great so if you work with flask you can recognize this code is basically the
03:02
Quick start from the flask website. The only difference is that you are Using evil instead of flask this is because if basically is just a subclass of flask so everything you can do with flask you can do with evil and this is a probably a good idea because I see people using even as a
03:21
Yes as a REST API but also as flask so they are using blueprints for example for adding new features to the API and stuff like that Then the other thing you need to do is you you need the launch script that we just saw and you need a settings file where you basically design your API and the idea here is like Django and other framework you just
03:47
Have a text file and in this case We are giving it to end points to our API's people and books as you see We aren't defining anything for these endpoints. So we are basically just saying hey
04:00
I want two endpoints on my REST PI's and these endpoints are named people and books and Then you just launch the API and your API is up and running and ready to to work for you For example, you can access the people endpoint You see that even if we didn't define anything for the endpoint and that we did you notice we didn't
04:24
define any kind of database connection actually, but The API is working. Anyway, what you get here is a few meta data, meta fields so items which is supposed to be the list of items from the people collection, which is empty of course and
04:41
the links is a Different meta field and we will cover it in a few minutes, but you can already guess what's up going on there Yeah, it's a Age ATA OAS I don't know how to speak English but basically they are just the links to the API endpoints and you can if you want to you can
05:08
Write your client in a way that it can navigate these links and build the client API and the client UE Based on these links you can turn this feature off if you want to
05:25
Hmm Okay, I'm just keeping it see let's connect the database now Very simple, of course, and then why we are here. Let's also define some Schema for our endpoint. So here what we are doing is
05:42
Defining a few fields and we are using a and we are defining some data types and some Validation rules so the name fields is a string It has a max length it is unique and email field if we can it is a string, of course But we can also set a regex for validation of this field
06:04
Don't use these are the exact same production because it sucks but just to give you an idea of What you can do and you can even if you look at the schema Keyword down there. You can even nest the sub dictionary with it within dictionaries at least within dictionaries and least or whatever you have you
06:27
and then we can By default an API is a read-only but of course you can change that in this case. We are Enabling Writing to the API endpoint. We are also allowing
06:44
Edit of the items Replacing the items and deleting the items. So you have to do this explicitly otherwise the API the endpoint will be read-only this is of course for safety reasons and Yeah a few more
07:00
Toys just to show you what you can do. You can set cache control on that point additional lookups a lot of stuff and so we defined our API endpoint we We wrote that launch script with a few lines and what do we get from this for this?
07:21
Well, first of all, you have filters for example Your clients can query the endpoints. They can do that using a mongo syntax of sorts so here you have an example where we are querying the people endpoint for the Last name though, but you can also use a Python syntax if you prefer
07:40
This is because maybe if your clients is being writing right wrote by you You can use mongo and there is no big deal But for example, if you expose your API to a website or to people you actually using gig They don't know anything about mongo. Maybe you prefer to use a different syntax. You can do that You can have a sorting on your endpoint in this case. We are sorting by descending order
08:07
You can use pagination it is enabled by default. So for example here we are asking give me page 2 and only 20 result maximum Projection this is very nice. You can say you have a document win with I don't know
08:22
50 fields You can say don't give me these fears in this request back to the client because I want to save on bandwidth or on performance for example in this case we are Telling the API don't send me the pictures. For example, don't send me the avatar because I don't need it
08:41
And here we are doing the contrary only return me last name For example, which is very handy if you are using your writing a mobile application For example, you want to optimize the traffic and the data being sent on the wire Another very cool feature is embedded resources. So basically here we will see an example here
09:02
We have we are asking to embed the author field. Let's see. What does it mean by default when you Get a document you will get for the author field. It's foreign key for maybe another endpoint This is what we would get by default But if you send a request with the embedded the keyword what you get is an embedded
09:26
document with the fuel author This is again to avoid sending two requests for the for the data that you need on your client by default your API will support both G is on an XML and
09:45
Here you have an example of The resources with G is only you know that very well by the way all the field names For the meter field names are configurable by you so you can change whatever you see here to suit your needs And this is the same resource in XML
10:02
We already saw hypermedia of the engine of application state at work Let's quick look here just to have an idea You get the link to the same item to the parent item next page if the pagination is enabled and you have more pages you get a link to the next page and Even a link to the last page, of course
10:22
Again, all these features are enabled by default, but you can switch them off For example, you don't want us to support a XML switch it off. You don't want a choice you you turn it off Etc. You can customize the API however you want document versions is something that we just released with the
10:42
The last release and it is basically Git for the arguments if you allow me and what you can you do when you switch this on basically you get versioning for your documents This feature has been contributed by a SpaceX engineer actually, so I am very proud of that and
11:01
You see here we are asking for version three of you over one document or Give me all the versions of the documents or you can even ask for the differ the diffs or there between the documents Maybe this is not something that everybody needs but it's very cool to have it at hand file storage You can store
11:21
Files within the API since by default even is a Supported by mong is using mongo. We are storing in GreedFS, which is basically Optimized storage for files in MongoDB how many of you are using mongo or things about think about using mongo in the future Okay, not. Okay quite a good number. We will see that there is also a SQLAlchemy branch for even later. So
11:47
keep your hopes high and Here an example of how you do a storage of a file when you define define your endpoint We saw earlier that you can define define a string type, but you can also define a media type and
12:06
Then when you send your data, what you do is just use a multi-part data forma data forma sorry post and you send your pic along with the other fields of your document your picture and When you get that document back you get the picture as a basis before string
12:28
And you can also enable This extended media info setting which basically is going to give you not only the file itself But also the extended the media the metadata about this field
12:43
So for example content type and name of the file size, etc Again you can disable enable for storage however you wish Rate limiting this is powered by Redis What you can do here is Set the number of requests that a single client is allowed to perform on your single endpoint
13:04
Per minute or I shouldn't say per minute, but their time window here We have an example where we are setting the get method limit at one request per minute window So you can add different
13:20
Limits per meter and Different time windows as well for every single endpoint so the first get gets back is is a Answered by the API and in the header section so you get information about rate limiting so you only have
13:40
You did there are there is one Request allowed on this endpoint per minute you have zero remaining and the next result of the time window it is at that time point in time the second request within the same minute will get a Two to nine and too many requests. This is just to give you an example of how this works. This is supposed to work
14:01
This is of course useful if you want if you have Performance issues or if you want to avoid your API getting hammered by some client Maybe a buggy client or somebody trying to do some kind of weird thing or attack on your API conditional request So the client can send every cast using the if modified scenes header and for example
14:26
Say, please return return me the data from this endpoint only if it has changed since so We don't get back always the same the same
14:40
I don't know in the people and point example we saw earlier. I When I get back the first result set this the next request I can get back new data only and on all the the data load If none match is similar
15:00
But we are using e tags here. So this is mostly used on the item endpoints so not only people and point but on the single person endpoint and for What it does is the same things basically give me the personality is something has changed on it There is also support for back inserts
15:22
So you can send multiple documents on the API and point With a single request here We are sending two ready documents for example and when you get back as a response is an array of responses actually because validation is performed on every single document and There are two me two
15:41
Options here. You can switch a coherence model off which is the default in this case You are only going to back the metadata back with they will be useful for Sending a subsequent request later and stuff like that or you can Basically say every time send me back the world document
16:03
included the meta fields This is something new we that was just added to the APS to the feature set quickly on that integrity concurrency controller you basic we are basically using e tags for a That integrity taxes
16:20
So when you try to modify a document if you don't provide a leaf match header you aren't going to get that patch in In fact, you are going to better to get a 403 back If you send an e tag, but this e tag is not matching the tag on the server You are going to get a precondition failed error
16:41
If you give me the e tag Which matches matches the document on the server then the the edit will go in Why this is because we want to avoid a client with an old version of the document Overwriting a newer version of the document on server. So only the client who already
17:01
Knows about the latest release of the document can update it Data validation, of course in this we have here. We have a response example of a bulky insert where the first document got an error and Clinton is not unique, but the second document was accepted
17:23
There is support for authentication Authorization so basic token authentication H Mac, which is basically what Amazon s3 is using On their platform even on all kind of pythons 3.4 and pypi included and
17:42
There is a lot of more stuff. We don't have time to go over that Versioning is here versioning. It means API versioning and non document versioning so you can have basically your endpoint version 1 version 2 version 3 of the your API It's bsd licensed open source. You can do whatever you want with it. You don't owe me any money
18:02
and Okay, what we saw So far is what you get for free without any line of coding. You just have to pull the switches on and off you Have this feature as we turning on and off. But what about developers if what how can I customize my API here?
18:22
I have a few example. For example, you can have custom data layers so in this case What we see is the code from the SQL HME branch, which is a working project in progress What you do is basically a subclass the base data layer
18:42
And and then you go off and write your own data layer for example, we have an extension which is called even elastic and is using a elastic search and Here we have a SQL HME under whatever you want to use This is an example of the SQL HME by the way here you see that in this approach what you do is
19:03
using SQL HME classes and you just register the schema so you don't have to write the resource schema in the settings file because SQL HME is already providing you the the classes with the basically the implementation of the your endpoint
19:21
Here is an example of the elastic search data layer and the MongoDB is doing exactly the same It's just a subclass in the basic data layer Authentication this is where You actually have to do some work because you need to Subclass the base class here and provide the authentication logic by yourself
19:44
This is of course because this is something you want to be in total control of You can do a lot of stuff with authentication you can lock the whole API You can lock only certain endpoints and leave other endpoints open to The public or read-only write-only read-and-write whatever role-based access control
20:03
There is a lot of stuff here, but we have time to look at it. Just three steps Tutorial to give you an idea of how you do this you basically just import your class basic code class You Override this check-out method here. We are basically saying hey
20:24
whatever Request comes to this endpoint with a username and min and password secret. Let it go is It is good to go. Otherwise it we will send back a not allow response and then what you do is when you
20:41
Create your instance you just pass your custom class to the to Eva and that's it Your API is now protected Of course in this case. We are just setting this Protection for the whole API all the API endpoints, but you can actually change your class forever for you
21:00
and every single endpoint or as I said before you can even leave some endpoints without protection and other the width and That's all you need them custom validation you can add the custom data types custom validation logic if you need to and That is very nice because for example in the next release we will add the support for
21:22
GOG zone and so we will have a point multi-point polygon polygons and all this kind of stuff And then we have event hooks This is I'm sorry if I'm going very quickly on this but with the time is short on us. So This is very nice because when something is going to happen on your API what you can hook callback function on basically every
21:47
event so here for you see that you can Set add the callback function every time an item is it be inserted for example or after? It is being inserted the same happens with get patch put delete and whatever have you
22:03
there is a Simple example here what we are doing in this example is update the documents that the client is sending us with a new field So you just define your callback function here We are and you see that the functions is getting the resource and basically the source is the endpoint and
22:23
documents is the collection of documents beings that are going to be inserted in the MongoDB and what I'm doing here is Just adding a new field or overwriting this field if it if it exists I gave this presentation and force them into selling fiber. This is why there is false them and I didn't have the time to update it and
22:43
and then when you are about to launch your API you just hook your function to the callback as you can see down below and Then you have custom file storage as I said before we store on gridfs by default But you can change it to whatever you want. There is a guy who did an s3
23:04
Class for example So he's a Eve instance is storing the data on s3 on Amazon s3 or you can store on file systems whatever you want, and then there is the community just a Few words on it
23:21
there are a few extensions available already released by the community for example if docs is a This is a very cool project. I show it Generates documentation for your API's and what it does is these You get a docs endpoint and When people access that endpoint
23:41
Instead of getting a JSON or XML. They are getting an HTML page with the documentation of the API and It is actively maintained and there are a lot of contributors on this project and what basically gives you an automated documentation for the API Eve mongo engine this is a
24:01
Basically a Connector between Eva and mongo engine if anybody of you using a mongo engine you can do what we have seen with SQL alchemy with this ORM for mongo You elastic we told about we saw it already if mocha is a mocking tool for Eva and
24:25
The night that the thing that matters to me is that the community about Eva is quite Is starting to grow quite a bit At the moment we have about 50 contributors to the project But what I really looking for is more contributors joining the project
24:41
So if you are interested in this kind of stuff You do know that you can actually contribute to the project as it is on github Of course and that we have a few tickets open and what I'm specifically looking for is people willing to work on the SQL alchemy Branch because it is now feature complete But before merging it what I need is people
25:03
Actually wanting to work on the SQL alchemy branch even after it is it's been released I don't want to merge the the branch and then I have people complain because something doesn't work I don't I don't want to look at it personally because it's not my kind of job. I'm doing something else So if you want to join a nice project and you're interested, please do so
25:25
We are working on give you some for the next release so you you will you will be able to define a Geo data point or geo data point and Validation will work. You can do queries on this kind of stuff etc
25:42
gzompi and if you Custom render crisis a lot of stuff is coming up in the is on the pipeline basically This is the URL for the project so you can go there read the documentation Get to the GitHub repository and see the changelog get in touch with me or My Twitter account of course
26:02
You can get in touch with me even at this account if you go to get up at Nicole a get up dot slash Nicole a lot you find the source code for the project and if you go on Twitter and You can follow me and I usually use Twitter to update on the merges. So the new comm is coming in and commenting and sometime even
26:24
I don't know like complaining about stuff and like that stuff like that, but well if you want you can follow me on Twitter and Basically, that's it. I wanted to give you a little demo, but I don't think we have time for Yeah, I figure so so if anybody wants to see something working just one thing there is there is actually a
26:46
Sheet here There is basically an online demo of an API is With you can consume with your clients or with even with the just chrome for example, this is postman but if you go to
27:01
if demo Roku app comm and slash people what you get back is an XML because of Chrome is either casting XML data But basically you can consume a API if you play with it Send get put request and stuff like that and play and see whatever what for a sample here. I'm
27:23
Asking for the people and point with Where people has a have a white last name and what I'm doing here is using the actually the hero cool Application in remote so you can play with it basically and then and get the first hand experience of the API Thank you very much
27:49
Okay, thank you Nicola we have a little bit time left for questions, so please raise your hand and I come with the microphone Thanks for the talk looks really interesting. Thank you. Do you have any support for testing your STPI testing? Yeah
28:08
What do you want my testing? I mean there is a huge test suite on the on the repo so every feature is being tested when every on every committee you show me today to the To the source code actually so what I mean is
28:23
It's easy to create the rest API, but what if I want to have some tests for it? For my for my API that they built with your framework like something yeah It is easy to do because you you can basically even again is a flask application is flask So whatever you can do with flask you can do with a which means that you can do test very easily on
28:44
Your own API actually you can also use our tests To see how it's done is done, and then I implement your own test on your own API is very easy to do The test which is something Which I'm kind of you know I miss a feelings about it
29:03
It's I kind of proud because there are I think five thousand five hundred tests, and I'm testing everything But it is in need of some refactoring actually so if you that's an ultra another area when You could think about joining the project. Thank you
29:21
Thanks for your project Do you also support URLs instead of IDs for example you showed us the the book and the author with the ID? Could you have a URL instead of an ID? Yes, what you can do it didn't show here is you can actually have nested the URLs so for example you can have
29:41
Cities slash city ID slash People slash people ID for example so the person in the in the city that this is not very good example Actually, but you get the idea, and you can design your own URLs Since again it is a fresh application, so you can you can even define
30:03
An additional URL for the same endpoint for example if you don't like the ID Which is a row number of course you can define a new URL based on the last name for example, so API dot-com slash Smith will get your
30:21
Person with the last name of Smith, so yes, you can play with the URL quite a bit quite a bit Okay, thanks a very. Thank you again Nicola. Thank you guys