value as JSON with status 201 and, when location is given, a Location header: the answer
to a request that made something.
response := created(42, tprint("/users/%", 42));
assert(response.status == 201);
location, found := find_header(response.headers, "Location");
assert(found && location == "/users/42");Doesn't run in the browser (skipped on wasm).
created :: (value: $T, location := "") -> Response
value as JSON with status 201 and, when location is given, a Location header: the answer
to a request that made something.
Parameters
- value: $T
- location := ""
Returns
response := created(42, tprint("/users/%", 42));
assert(response.status == 201);
location, found := find_header(response.headers, "Location");
assert(found && location == "/users/42");Doesn't run in the browser (skipped on wasm).