OkayTeacher
EN English 한국어 日本語 中文 हिन्दी বাংলা اردو Español Português Français Deutsch Русский العربية Bahasa Indonesia Tiếng Việt ไทย Türkçe

How to enable notifications

Notifications are unavailable in this browser or on this address. Try a supported browser on the secure SONUB site.

If notifications are blocked, allow them in your browser settings.

  1. Open the site controls beside the address bar, or your browser’s site settings. Set Notifications for this site to Allow.
  2. In your device settings, allow notifications for your browser and check Do Not Disturb or Focus.
  3. Return to SONUB, reload the page, and use the bell to enable notifications.

On iPhone or iPad, add SONUB to your Home Screen, open it there, then allow notifications.

All Vibe Coding topics

Web Client

Everything that asks a server for something.

A browser is a web client, and so is one line of curl. Type an HTTP request by hand with nc, then watch the same text go by in curl and Chrome DevTools.

A browser window, a dark terminal window and a smartphone each send an envelope to the same server, and pages come back to each of them.
A , and a phone app play the same role: they ask first, and the answers.

curl: the client you will use every day

curl does properly what our script does roughly: , , , uploads, , . It is on almost every machine, and it is the standard way to test a server without a browser in the way.

terminal
# body only
curl http://localhost:8084

# body plus the response headers
curl -i http://localhost:8084

# the whole exchange, request headers included
curl -v http://localhost:8084

The options that matter

OptionWhat it does
-iShow the headers as well as the body. The first thing to reach for when a page is not what you expected.
-vVerbose: show the you sent and the response you got, line by line, including the connection itself.
-LFollow redirects. Without it, a gives you an almost empty response instead of the page you wanted.
-o FILESave the response to a file instead of printing it. This is curl as a download tool.
-H "Name: value"Add a request header — a content type, an authorisation , a language preference.
-d "data"Send instead of just asking. -d alone makes it a (pick another method with -X), and this is how you test a form or an from the .
-sSilent: no progress meter. Use it whenever the output feeds into another command or a script.
-A "name"Pretend to be a particular browser. Some sites answer differently depending on who is asking.

Calling an API

Most of what a modern app talks to is not a page but an API returning . curl fetches it, and jq makes it readable — together they are how you check an before writing a single line of application .

terminal
# fetch JSON and pick one field out of it with jq
curl -s https://api.github.com/repos/sveltejs/svelte | jq '.stargazers_count'

# send JSON with POST
curl -X POST https://httpbin.org/post \
  -H 'Content-Type: application/json' \
  -d '{"name":"SONUB","level":1}'

# download to a file
curl -L -o page.html https://sonub.com

Get into the habit of testing with curl first. If curl gets the right answer, the server is fine and the is in your . If curl also gets a strange answer, the problem is on the server side — and you have not wasted an afternoon looking in the wrong place.

You mark this yourself. Nothing is graded here.

Mark this step as understood?

This cannot be undone yet, so mark it only when you really understand.

Marked as understood

You mark this yourself. Nothing is graded here.