Skip to main content

23 posts tagged with "tweak"

View All Tags

How to Simulate HTTP Request Errors

· 4 min read
Daniel Caldas
Co-founder

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.).

This post is a short, hands-on walkthrough: one demo app, one simulated 500, and the fix that gets the UI out of a stuck loading state. For the full list of failures worth testing (401, 422, 429, network errors, timeouts, malformed JSON) with a rule for each, read How to Test Error States in Your Frontend App.

Simulate Delays in HTTP Requests

· 4 min read
Daniel Caldas
Co-founder

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 in the Browser (2026 Guide)

· 18 min read
Daniel Caldas
Co-founder

To mock an API call is to answer a request your app makes with a response you wrote, instead of the one the server would send. The app cannot tell the difference: it receives the JSON, the status code and the headers you chose, and renders whatever they lead to.

You need it more often than you would think. The endpoint you are building against does not exist yet. A bug only shows up with a payload you cannot reproduce. The staging server is down on demo day. You want to see the screen for a 500, an empty list or a response that takes eight seconds. In all of these, waiting for the backend is the slow option.

This guide covers what mocking is, the three ways to do it and their trade-offs, then shows step by step how to mock a response right in the browser with tweak: no code, no proxy, no change to your app.