Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document FetchResponse#contentType as nullable #211

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions _source/reference/drive.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,20 @@ Turbo dispatches a variety of [events while making HTTP requests](/reference/eve

Turbo dispatches a variety of [events while making HTTP requests](/reference/events#http-requests) that reference `FetchResponse` objects with the following properties:

| Property | Type | Description
|-------------------|-------------------|------------
| `clientError` | `boolean` | `true` if the status is between 400 and 499, `false` otherwise
| `contentType` | `string` | the value of the [Content-Type][] header
| `failed` | `boolean` | `true` if the response did not succeed, `false` otherwise
| `isHTML` | `boolean` | `true` if the content type is HTML, `false` otherwise
| `location` | [URL][] | the value of [Response.url][]
| `redirected` | `boolean` | the value of [Response.redirected][]
| `responseHTML` | `Promise<string>` | clones the `Response` if its HTML, then calls [Response.text()][]
| `responseText` | `Promise<string>` | clones the `Response`, then calls [Response.text()][]
| `response` | [Response] | the `Response` instance
| `serverError` | `boolean` | `true` if the status is between 500 and 599, `false` otherwise
| `statusCode` | `number` | the value of [Response.status][]
| `succeeded` | `boolean` | `true` if the [Response.ok][], `false` otherwise
| Property | Type | Description
|-------------------|--------------------|------------
| `clientError` | `boolean` | `true` if the status is between 400 and 499, `false` otherwise
| `contentType` | `string` \| `null` | the value of the [Content-Type][] header
| `failed` | `boolean` | `true` if the response did not succeed, `false` otherwise
| `isHTML` | `boolean` | `true` if the content type is HTML, `false` otherwise
| `location` | [URL][] | the value of [Response.url][]
| `redirected` | `boolean` | the value of [Response.redirected][]
| `responseHTML` | `Promise<string>` | clones the `Response` if its HTML, then calls [Response.text()][]
| `responseText` | `Promise<string>` | clones the `Response`, then calls [Response.text()][]
| `response` | [Response] | the `Response` instance
| `serverError` | `boolean` | `true` if the status is between 500 and 599, `false` otherwise
| `statusCode` | `number` | the value of [Response.status][]
| `succeeded` | `boolean` | `true` if the [Response.ok][], `false` otherwise

[Response]: https://developer.mozilla.org/en-US/docs/Web/API/Response
[Response.url]: https://developer.mozilla.org/en-US/docs/Web/API/Response/url
Expand Down