Asserts a 2xx status, parses the JSON body and disposes the response. Don't add a separate status check next to it.
the body's type, taken from the response: a client method declared as this.get<ProductList>(...) makes this return a ProductList
this.get<ProductList>(...)
the response to read
the parsed body
const body = await getBody(await Products.list()); Copy
const body = await getBody(await Products.list());
Asserts a 2xx status, parses the JSON body and disposes the response. Don't add a separate status check next to it.