查询
最新公告

使用PHP和Symfony框架构建面向操作的Api

English | June 16, 2024 | ASIN: B0D79KGL7P | 172 pages | EPUB | 0.25 Mb

In this book, the author tries to show how to use the Symfony framework powerful features to build an API using the operation concept as a resource. Starting from this base, the author takes advantage of several tools and components of the Symfony framework to build an API capable of finding out what operation must be executed and what data is required to execute it based on the information received within the request payload. To progress step by step, the book has been divided into the following parts or chapters Introduction: This part explains how an operation-oriented API can help to define API operations that could not be defined using a CRUD way. Crafting inputs, outputs and operations: This part uses many Symfony DIC features such as Tagged iterators and service configurators and some components like Validation, Serializer and the Symfony Event System to construct the necessary services to discover and execute operations. Securing operations: This part uses Symfony firewalls and voters to protect both the API endpoint and the operations. As a plus, it shows how to configure a rate limiter to control the number of requests received. Background Execution of API Operations: This part uses the Symfony Messenger so that operations that can take some time to be executed can be performed in the background. Context-Specific Operations: This part shows how CRUD and Operation-Oriented endpoints can live together and how to control what operations an endpoint can execute depending on its context. Testing the API: As a last part, we will use the Symfony API Testing capabilities to create some tests that ensures our API behaves as expected. Before reading this book, its important to take into account the following This book assumes a certain level of familiarity with the Symfony framework. It is not a tutorial or guide about the framework but a guide about how to construct an operation-oriented api using the Symfony features. This book does not delve into the development of specific operations themselves. While we may use operation examples like "SendPayment" for illustrative purposes, the primary goal is to demonstrate how to construct the necessary code to establish a unified API endpoint capable of handling various operations effectively.

英文|2024年6月16日|ASIN:B0D79KGL7P|172页|EPUB | 0.25 Mb 在这本书中,作者试图展示如何使用Symfony框架强大的功能来构建一个以操作概念为资源的API。从这个基础开始,作者利用Symfony框架的几个工具和组件来构建一个API,该API能够根据在请求有效负载中接收到的信息来找出必须执行的操作以及执行该操作所需的数据。为了循序渐进,本书分为以下部分或章节介绍:这部分解释了面向操作的API如何帮助定义无法使用CRUD方法定义的API操作。制作输入、输出和操作:这部分使用许多Symfony DIC功能,如标记迭代器和服务配置器,以及一些组件,如验证、序列化器和Symfony事件系统,来构建发现和执行操作所需的服务。安全操作:本部分使用Symfony防火墙和投票者来保护API端点和操作。另外,它还展示了如何配置速率限制器来控制接收到的请求数量。API操作的后台执行:本部分使用Symfony Messenger,以便可以在后台执行可能需要一些时间才能执行的操作。特定于上下文的操作:这部分展示了CRUD和面向操作的端点如何共存,以及如何根据其上下文控制端点可以执行哪些操作。测试API:作为最后一部分,我们将使用Symfony API测试功能来创建一些测试,以确保我们的API按预期运行。在阅读本书之前,重要的是要考虑以下几点。本书假设您对Symfony框架有一定的熟悉程度。它不是关于框架的教程或指南,而是关于如何使用Symfony功能构建面向操作的api的指南。本书没有深入探讨具体操作本身的开发。虽然我们可以使用“SendPayment”之类的操作示例来进行说明,但主要目标是演示如何构建必要的代码,以建立能够有效处理各种操作的统一API端点。
Download from free file storage


本站不对文件进行储存,仅提供文件链接,请自行下载,本站不对文件内容负责,请自行判断文件是否安全,如发现文件有侵权行为,请联系管理员删除。