Overview
ofetch.raw() returns the complete Response object along with the parsed data, giving you access to headers, status codes, and other response metadata.
Basic Usage
When to Use
Useofetch.raw() when you need:
- Response headers (e.g., pagination info, rate limits)
- HTTP status codes
- Response metadata
- Full Response object for further processing
Response Structure
Fromsrc/types.ts:137-139:
- Extends the standard
Responseinterface - Includes all native Response properties and methods
- Adds
_dataproperty with the parsed body
Common Use Cases
Accessing Response Headers
Rate Limit Information
Checking Status Codes
Content Type Detection
How It Works
Fromsrc/fetch.ts:89-257:
- Creates a fetch context with request and options
- Processes the request (interceptors, URL building, etc.)
- Executes the fetch call
- Parses the response body into
_data - Returns the full Response object
Regular vs Raw Response
Fromsrc/fetch.ts:259-262:
ofetch():
ofetch.raw():