chapter four
4 APIs – The piping between our components
This chapter covers
- Introduction to the FastAPI Framework
- Documenting our APIs using the OpenAPI Standard
- Testing our APIs using Postman and Locust
- API Management with WSO2
An Application Program Interface (API) is simply a way to interact with a software component. Generally, when we speak about APIs we are talking about the REST (Representational State Transfer) API standard. However, there are other standards such as GraphQL and the older SOAP (Simple Object Access Protocol). We may also come across Message Queuing such as IBM Websphere MQ and RabbitMQ. Table 4.1 shows some pros and cons of the more common approaches to implementing APIs.
Table 4.1 Pros and Cons of different APIs
|
|
REST
|
SOAP
|
GraphQL
|
|
Pros
|
Simple, builds upon standard HTTP methods
Multiple data formats can be supported, although JSON is most common
|
Relies on XML based messaging
Enterprise-level security
|
Efficient
Single Endpoint
Strongly typed
|
|
Cons
|
Versioning and breaking changes can be complex to manage
Number of endpoints may become unwieldy
|
Complex to implement
Verbose XML based messages
|
Steeper learning curve
|