Навигация по каналу.
Всем привет, с вами разработчик из Петербурга, а здесь мой личный блог. Многие люди говорят мне, что им нравится, как я пишу, и это поддерживает существование данного канала. Тут совершенно точно не будет примитивного агрегатора новостей, очередной подборки мемов или филиала твиттера с короткими эмоциональными высказываниями. Данный блог — вдумчивый и авторский, содержит мои размышления и пережитый опыт. Подписывайтесь, если вам действительно интересно читать. Буду рад также вашему участию в обсуждениях.
Вот основные теги:
#dev — программирование
#gadgets — гаджеты
#games — видеоигры и настолки
#fiction — книги, фильмы
#hobby — DIY и другие хобби
#web — интернет, соцсети
#life — просто о жизни
https://blog.miguelgrinberg.com/post/designing-a-restful-api-with-python-and-flask
In recent years #REST (REpresentational State Transfer) has emerged as the standard architectural design for #web services and web #APIs.
In this article I'm going to show you how easy it is to create a RESTful web service using Python and the Flask microframework.
What is REST?
The characteristics of a REST system are defined by six design rules:
Client-Server: There should be a separation between the #server that offers a service, and the #client that consumes it.
Stateless: Each request from a client must contain all the information required by the server to carry out the #request. In other words, the server cannot store information provided by the client in one request and use it in another request.
Cacheable: The server must indicate to the client if requests can be cached or not.
Layered System: Communication between a client and a server should be standardized in such a way that allows intermediaries to respond to requests instead of the end server, without the client having to do anything different.
Uniform Interface: The method of communication between a client and a server must be uniform.
Code on demand: Servers can provide executable code or scripts for clients to execute in their context. This constraint is the only one that is optional.