The context — Basics · Hono

Read what a request carries, its query string, its headers and its JSON body, and shape the response: a status, a header, text or JSON depending on what the client accepts.

What you will learn

Read the theory for The context

All Basics lessons

All Hono courses

loading types…

What you'll learn

  • Read the query string with c.req.query() and a header with c.req.header()
  • Parse a JSON body with await c.req.json<T>() in an async handler
  • Set a status with the second argument of c.json() and a response header with c.header()