Documents / @faasjs/react / Response
Class: Response<T>
Wrapper class for HTTP responses from FaasJS functions.
Provides a consistent interface for handling server responses with status code, headers, body, and parsed data. Automatically handles JSON serialization and status code defaults.
Type Parameters
T
T = any
The type of the data property for type-safe response handling
Constructors
Constructor
new Response<
T>(props?):Response<T>
Create a wrapped response object.
Parameters
props?
ResponseProps<T> = {}
Returns
Response<T>
Properties
body
readonlybody:any
Raw response body.
data?
readonlyoptionaldata?:T
Parsed response payload when JSON data is available.
headers
readonlyheaders:ResponseHeaders
Response headers keyed by header name.
status
readonlystatus:number
HTTP status code exposed to callers.