Skip to content

Commit

Permalink
Updating status code references (#388)
Browse files Browse the repository at this point in the history
* Update README.md

* Update +error.svelte

* Update +error.svelte

* Update README.md
  • Loading branch information
fubar1337 authored Dec 14, 2023
1 parent 9379080 commit f0cf7ad
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion content/tutorial/01-svelte/common/src/routes/+error.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
code
<a
target="_blank"
href="https://httpstatusdogs.com/{$page.status}"
href="https://http.dog/{$page.status}"
>{$page.status}</a
>
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
code
<a
target="_blank"
href="https://httpstatusdogs.com/{$page.status}"
href="https://http.dog/{$page.status}"
>{$page.status}</a
>
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export async function POST({ request, cookies }) {

As with `load` functions and form actions, the `request` is a standard [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) object; `await request.json()` returns the data that we posted from the event handler.

We're returning a response with a [201 Created](https://httpstatusdogs.com/201-created) status and the `id` of the newly generated todo in our database. Back in the event handler, we can use this to update the page:
We're returning a response with a [201 Created](https://http.dog/201) status and the `id` of the newly generated todo in our database. Back in the event handler, we can use this to update the page:

```svelte
/// file: src/routes/+page.svelte
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export async function DELETE({ params, cookies }) {
}
```

Since we don't need to return any actual data to the browser, we're returning an empty [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) with a [204 No Content](https://httpstatusdogs.com/204-no-content) status.
Since we don't need to return any actual data to the browser, we're returning an empty [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) with a [204 No Content](https://http.dog/204) status.

We can now interact with this endpoint inside our event handlers:

Expand Down

1 comment on commit f0cf7ad

@vercel
Copy link

@vercel vercel bot commented on f0cf7ad Dec 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.