During our web development daily activities it's common to poke around the browser to test our applications or replicate weird behaviors, often caused by API calls errors. In this short tutorial you can learn how to override a XHR/Fetch response status code with the tweak browser extension.
7 posts tagged with "tweak"
View All TagsHow to Block an HTTP Request
Modern browsers have advanced development toolkits allowing developers to inspect and debug their code in detail. This article will go through the options you have to block HTTP requests with modern browsers.
How to Mock a GraphQL Request
This article will guide you on mocking a GraphQL request directly in the browser with our extension.
APIs are king in the industry, and GraphQL has changed the APIs game for good with rising adoption. We want to write this article specifically tailored to developers working with GraphQL APIs. Let's begin!
How to Mock HTTP Requests in the Android Yandex Browser
Some time back, we've received feedback from a user stating that they could use our browser extension in mobile using the Yandex browser and gave some feedback about usability. We don't develop for mobile, but when we found out it was possible, we improved our import/export flow to allow users to quickly load in a JSON file with many rules and operate with the app while mocking requests with tweak. Let's look at how to achieve it.
How to Simulate HTTP Request Errors
Errors handling is part of our work as developers. You can try to ignore them at first, but to offer a good user experience, you don't want your website breaking just because one of the API endpoints decided to give up on you. These days we try to find clever workarounds to run our applications with a graceful degradation strategy. We build software to work in an optimal environment while providing certain fallbacks not to break the experience entirely when there's some disturbance in the system (e.g., lousy network condition, CPU lag, etc.).
In this article, we will understand how to maximize productivity when tackling HTTP requests error handling from a front-end development perspective.
Simulate Delays in HTTP Requests
There might be a few reasons why we would want to delay an HTTP request:
- You want to test how your UI behaves to a slow response from an upstream service.
- There's a race condition in my code, and I suspect that it happens when the request to A is slower than the request B.
- You want to show off that beautiful loading animation you've been working on all day!
How to Mock API Calls
A Pragmatic Mocking Tool
When I first started my career in the software industry, I began to get familiar with Single-page applications and how they interact with servers, mainly through HTTP requests to retrieve or send data to the end-user. If you're working with the front end, there's a very high chance you found yourself in one (or multiple) of the following scenarios.