After some time, the no of users increase and we need to scale up our application, then we got to use some kind of load balancing technology with multiple instances of our server deployed.
Here POSTMAN will act as our presentation layer and generate a HTTP request which will be received by the API Gateway and according to our request URL, it will forward the request to the relevant Lambda Function.
The lambda function will process the data and provide the gateway with the necessary response.
As the first part, we need to create a piece of code to be put into our lambda function.
Note that this is a very basic example and you can add security, caching, database support, logging, and many more to this application and create an enterprise-level application using the state of the art technology which is provided by AWS.
Hitting the above API, if we send raw data in JSON format (with Content-Type header set to application/json), the output contains exactly the same data that we are sending in the request.
An API by Django REST Framework has a default set of parsers that it uses to detect the type of the data in the request.
Well, let’s take a look at the default list of parsers that the API is using to understand the request type.
i.e. The API looked into the Content-Type for the first request, which was application/json and hence selected the JSONParser, whereas for the second request with Content-Type image/jpeg, the API had no parser in the default list available.
This parser is enabled by default, so if we hit the API with a file in a form-data, then the backend will be able to understand the content type in the request.