Simulating 404 HTTP status code in Blinkit Search API
Tags: frontend, frontendtesting, requestly, testing
Published: 2021-12-29 19:38:21

---
title: Simulating 404 HTTP status code in Blinkit Search API
published: true
date: 2021-12-29 13:07:26 UTC
tags: frontenddevelopment,frontendtesting,requestly,testing
canonical_url: https://requestly.com/blog/simulating-404-status-code-in-blinkit-search-api/
---

Nobody wants to see errors in their API. But they appear at times when least expected. The possible scenarios when an error pops up could be something is wrong with the request or some problem with the API. Whatever may be the cause, one thing is sure traffic would stop.

API crashes shouldn’t disrupt the user experience. Errors should be handled at the client-side so that the user knows that something is wrong and can move on from there.

In the development phase, the consumers of API won’t wait till the API is entirely built to start their development. In this scenario, they can mock server responses and begin their development. Testing the application for error responses is vital so that user traffic is not blocked.

A QA tester or Product manager would want to mock various error responses to check how the application handles the errors.

### How to Simulate API error responses using Requestly

[Requestly](https://requestly.com) is a tool that intercepts all the network requests and allows users to modify them. It enables users to Modify Headers, Redirect URLs, Switch hosts, Mock API responses, Delay network requests, Insert custom scripts. It is available as a desktop app and browser extension on all major browsers.

[Requestly](https://app.requestly.io) app can simulate status code responses by using the redirect rule to redirect to a mock API that overrides the status code. In simple words, you are hitting the mock API instead of the actual API.

![Mock Server](https://cdn-images-1.medium.com/max/1024/0*6YarTmTQHUpMyBl-.png)

I used it to simulate status code responses on certain prominent websites.

I tried this with the following sites to see how the site handles the simulation of 500- Internal Server Error status code.

I created a mock using requestly setting 404 status code.

![](https://cdn-images-1.medium.com/max/1024/0*c7r4SbzunHW_dLmQ.png)
_Mock for simulating 404 response code on blinkit search_

After some observation, I found that blinkit search API follows the pattern [https://blinkit.in/v5/search/\*](https://blinkit.in/v5/search/\*)

![](https://cdn-images-1.medium.com/max/1024/0*8PC6loLpaAJPnoqh.png)
_Rule redirecting blinkit search to mock API response_

The blinkit website went into infinite loading on searching as a 404 response status code was simulated in the search API. The error is not handled here instead. If some message were to the user, the experience would have been better.

![](https://cdn-images-1.medium.com/max/1024/0*-AWQdHCXJUwU7bLG.png)
_Searching on Blinkit_

Get the rule here: [https://app.requestly.io/rules/#sharedList/1640614559005-blinkit-search-404](https://app.requestly.io/rules/#sharedList/1640614559005-blinkit-search-404)

This is how I used Requestly to simulate 404 in the blinkit search. I hope this article has helped you and empowers you to simulate different status codes.

Happy Debugging!

Further Resources:

- [Simulate different API status code using Requestly](https://dev.to/requestlyio/simulate-different-api-status-code-using-requestly-1hd9)
- [Simulating 500 when Tweeting](https://dev.to/requestlyio/simulating-500-http-status-code-in-create-tweet-api-on-twitter-2b7d)

By [@nafees87n](https://www.linkedin.com/in/nafees87n/)

_Originally published at_ [_https://requestly.com_](https://requestly.com/blog/simulating-404-status-code-in-blinkit-search-api/)_._