Collection 04

APIs

Find the call, its return value, and the boundary that changes it.

API entries show the signature, one real input, and the value a caller actually receives. They separate what the platform returns from what a program often assumes it returns.

Index

On this shelf

NamePlatformBoundary question
When Is Response.ok True? Reference Fetch Which status codes make ok true, and what does it not tell you?
Building Arrays with Array.from() Reference JavaScript When does Array.from() create a real array from an iterable or array-like?
Resolving Paths with pathlib.Path.resolve() Reference Python What does resolve() change, and what does it require from the filesystem?
Reading Repeated Parameters with URLSearchParams.getAll() Reference URL Why does get() return only one value when the URL repeats a key?

Reading path

A way in

Start with Response.ok when a status check surprises you. The URLSearchParams entry is a useful next stop when the value itself is repeated rather than missing.

  1. 01 When Is Response.ok True?Response.ok is true exactly when the HTTP status is 200 through 299, and false for every other status. It does not validate the body, content type, or application-level success, and opaque responses report ok as false.
  2. 02 Reading Repeated Parameters with URLSearchParams.getAll()get() returns only the first value for a repeated query key, while getAll() returns every value in order as an array. getAll() also returns an empty array for a missing key, where get() returns null.

All entries

Full catalog