Start here - the basics
New to networking? A plain-English guide to requests, responses, proxies and status codes, so everything else in Mittelware makes sense.
You don't need any networking background to use Mittelware. This page explains the handful of ideas the rest of the docs build on. Five minutes here will make everything else easier. If you already know what a request, a proxy and a status code are, skip ahead to Getting started.
What happens when an app talks to the internet#
Whenever an app shows you something from the internet, such as a web page, a weather forecast or a list of users, it asks a computer somewhere else for that information. There are always two sides:
- The client is the app that asks. A browser, a mobile app, a script or a tool like Postman can all be clients.
- The server is the computer that answers.
The question the client sends is called a request. The answer the server sends back is called a response. Together they are one HTTP exchange, and Mittelware shows each one as a single row on its Flows page.
Think of ordering at a restaurant. The request is your order ("one fake user, please"). The response is the plate that comes back.
What is inside a request#
Every request has the same few parts:
| Part | What it is | Example |
|---|---|---|
| Method | What you want to do | GET (read something), POST (send something new), PUT / PATCH (change something), DELETE (remove something) |
| URL | Where you want to do it | https://jsonplaceholder.typicode.com/users/1 |
| Headers | Extra notes about the request | Which browser is asking, which language you prefer, a login token |
| Query parameters | Options added to the end of a URL after a ? |
?page=2&sort=name |
| Body | Data you send along (not every request has one) | The text of a form you submitted, as JSON |
A URL itself has pieces too. In https://api.example.com:8443/v1/users?page=2:
httpsis the scheme (httpis plain,httpsis encrypted).api.example.comis the domain, which names the server.8443is the port, a numbered door on that server. If it's missing, the scheme decides:443for https,80for http./v1/usersis the path, which says which thing you want.?page=2is the query string.
What is inside a response#
| Part | What it is | Example |
|---|---|---|
| Status code | A three-digit result | 200 means "here you go", 404 means "that doesn't exist" |
| Headers | Extra notes about the answer | The type of data, how long to keep a copy, cookies |
| Body | The actual content | A web page, an image, or data as JSON |
Status codes you will see most#
| Code | Meaning | Plain English |
|---|---|---|
200 |
OK | It worked |
201 |
Created | It worked, and something new was made |
204 |
No Content | It worked, and there's nothing to send back |
301 / 302 |
Redirect | Look over there instead |
304 |
Not Modified | You already have the latest copy, use that one |
400 |
Bad Request | The request didn't make sense |
401 |
Unauthorized | You need to log in |
403 |
Forbidden | You're logged in but not allowed |
404 |
Not Found | There's nothing at that address |
429 |
Too Many Requests | Slow down |
500 |
Server Error | The server broke |
502 / 503 |
Bad Gateway / Unavailable | The server (or something in front of it) is down or overloaded |
The first digit tells you the story: 2xx is success, 3xx is a redirect, 4xx means the client did something wrong, and 5xx means the server did.
What is JSON#
Most apps that talk to servers exchange data as JSON, a simple text format of names and values:
{
"id": 1,
"name": "Leanne Graham",
"email": "Sincere@april.biz"
}
Curly braces hold an object, square brackets hold a list, and text goes in quotes. Mittelware shows JSON as a collapsible tree so you can read it easily.
What is a proxy, and what does Mittelware do#
Normally a request goes straight from your app to the server. A proxy is a go-between that you place in the middle. The request goes to the proxy first, and the proxy passes it on.
Without a proxy: your app ───────────────────────► server
With Mittelware: your app ───► Mittelware ───► server
(sees everything,
can change things)
Because Mittelware sits in the middle, it can do three things:
- Watch. Every request and response that passes through is recorded, so you can read them on the Flows page. This answers questions like "what is my app really sending?"
- Pause. It can hold a request before it leaves, so you can look at it or edit it by hand.
- Change. With rules, it can block a request, rewrite part of it, or replace the response with one you wrote. You test how your app copes with a slow server, a
500error or different data, without touching the server's code.
All of this happens on your own computer. The proxy listens at 127.0.0.1 (the address a computer uses to mean "myself") on a port, 8080 by default, so other devices on your network can't reach it.
What is HTTPS, and why does Mittelware ask about a certificate#
HTTPS is the encrypted version of HTTP. Encryption scrambles the traffic so nobody between you and the server can read it. That is great for privacy, but it also means a tool in the middle sees only scrambled data.
For you to see inside your own HTTPS traffic, Mittelware creates a small certificate of its own and asks your computer to trust it. Then it can unscramble the traffic from your apps, show it to you, and scramble it again on the way out. The certificate stays on your device and applies to your user account only. HTTPS & certificates explains it in full, including how to remove it.
Glossary#
| Term | Meaning |
|---|---|
| API | A server that apps talk to for data, rather than a web page for people to read |
| Body | The main content of a request or response |
| Chunk | One piece of a response that arrives in several pieces. Mittelware lists every chunk of a stream with the moment it arrived |
| Client | The app that makes a request |
| Flow | One request and its response, shown as a single row in Mittelware |
| Header | A named note attached to a request or response |
| HTTP / HTTPS | The language apps use to talk to servers; HTTPS is the encrypted version |
| JSON | A text format for data, made of names and values |
| Method | The kind of request: GET, POST, PUT, PATCH, DELETE |
| Mock | A fake answer you write yourself, used in place of the real one |
| Proxy | A go-between that requests pass through |
| Query string | The ?name=value options at the end of a URL |
| Request | The message a client sends to a server |
| Response | The message a server sends back |
| Rule | An instruction for Mittelware: when traffic looks like this, do that |
| Server | The computer that answers requests |
| Stream | A response the server sends a little at a time and keeps open while it works, such as an AI chat answer appearing word by word |
| Status code | The three-digit result of a request, such as 200 or 404 |
| URL | The full web address of the thing being requested |
Ready to try it?#
Next up is Getting started: you'll install Mittelware, watch a real request travel through it, and change a response yourself in about ten minutes.