A utility first API that helps you write better code without changing the way you work. All the HTTP response status codes available from one convenient API.Let's get started
Don't waste your time hard coding response types. Instead, write code that makes sense in the context of your application. Use your endpoints, your data, and your logic; Let us handle the REST.
# django-rest-framework
# views.py
class YourView(APIView):
status_code = 503
url = f"http://relay-it.dev/api/{status_code}"
def get(self, request, format=None):
""" Your request handler. """
response = requests.get(f"{self.url}/your-endpoint")
# if the resource is unavailable
if response.status_code == 503: #status code we are testing
return Response(
{"message": "A dependent service is unavailable"},
status=status.HTTP_503_SERVICE_UNAVAILABLE)
return Response(status=status.HTTP_200_OK)
Writing good code shouldn't be hard. It's a matter of having the right tools for the job.
Relay-It helps you build your frontend in a way that makes sense. You request data, you get data, you render the data. Why waste time trying to hard code your response types only to delete it later?
Waste less time waiting for an API to be developed. Anticipate the API, the data, and the logic. Once you are ready to go live, change the domain.
{
"status": 201,
"name": "Created",
"message": "The request succeeded, and a new resource was created as a result. This is typically the response sent after 'POST' requests, or some 'PUT' requests"
}
{
"status": 201,
"name": "Created",
"message": "The request succeeded, and a new resource was created as a result. This is typically the response sent after 'POST' requests, or some 'PUT' requests"
}