REST principles require that the server response contain the following components:

A status string

The status string contains a three-digit status code that indicates whether the request was successful or unsuccessful. For example, 2XX codes indicate successful execution, while 4XX and 5XX codes indicate errors. 3XX codes indicate a URL redirection.

The following are some common status codes:

200: general successful execution response
201: POST method success response
400: Invalid request that the server cannot process
404: resource not found

Message Text

The response text contains a representation of the resource. The server selects the appropriate presentation format based on the content of the request headers. Clients can request information in XML or JSON formats: they define the data record as plain text. For example, if a client requests the name and age of a person named John, the server returns a JSON representation in the following format:

‘{“name”: “John”, “age”:30}’.

Headers

The response also contains headers or metadata about the response. These give more context to the response and include information such as server name, encoding, date, and content type.

How can AWS help manage RESTful APIs?

Amazon API Gateway is a fully managed service for developers to create, publish, maintain, monitor, and secure APIs at any scale. API Gateway allows you to create RESTful APIs for real-time two-way communication applications.

With the Gateway API, you can:

Provide users with high performance for API requests and responses.
Enable API access using AWS Identity and Access Management (IAM) and Amazon Cognito, which provide native OAuth support.
Run multiple versions of the same API at the same time using API Gateway, allowing you to quickly refine, test, and launch new versions.
Track performance metrics and information about API requests, data latency, and error rates from API Gateway.