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

i18n(pt-BR): create reference/errors/rewrite-with-body-used.mdx #10389

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
20 changes: 20 additions & 0 deletions src/content/docs/pt-br/reference/errors/rewrite-with-body-used.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: Astro.rewrite não pode ser usado depois que o corpo da requisição já foi lido
i18nReady: true
githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/errors/errors-data.ts
---

> **RewriteWithBodyUsed**: Astro.rewrite() não pode ser usado se o corpo da requisição já foi lido. Se você precisar ler o corpo, primeiro clone a requisição.

## O que deu errado?
`Astro.rewrite()` não pode ser usado se o corpo da requisição já foi lido. Se você precisar ler o corpo, primeiro clone a requisição. Por exemplo:

```js
const data = await Astro.request.clone().formData();

Astro.rewrite("/target")
```

**Veja também:**
- [Request.clone()](https://developer.mozilla.org/en-US/docs/Web/API/Request/clone)
- [Astro.rewrite](/pt-br/reference/api-reference/#rewrite)

Check failure on line 20 in src/content/docs/pt-br/reference/errors/rewrite-with-body-used.mdx

View workflow job for this annotation

GitHub Actions / Check Links

Broken fragment link in src/content/docs/pt-br/reference/errors/rewrite-with-body-used.mdx, line 20: The linked page does not contain a fragment with the name "#rewrite". Available fragments: #theme-icons, #gradient, #starlight__sidebar, #__tab-start, #__tab-guides-and-recipes, #__tab-reference, #__tab-integrations, #__tab-third-party-services, #starlight__mobile-toc, #starlight__on-this-page--mobile, #starlight__on-this-page, #_top, #global-astro, #astroglob, #arquivos-markdown, #arquivos-astro, #outros-arquivos, #astroprops, #astroparams, #astrorequest, #astroresponse, #astrocookies, #get, #has, #set, #delete, #merge, #headers, #astrocookie, #value, #json, #number, #boolean, #astrocookiegetoptions, #decode, #astrocookiesetoptions, #domain, #expires, #httponly, #maxage, #path, #samesite, #secure, #encode, #astroredirect, #astrorewrite, #astrourl, #astroclientaddress, #astrosite, #astrogenerator, #astroslots, #astroslotshas, #astroslotsrender, #astroself, #astrolocals, #astropreferredlocale, #astropreferredlocalelist, #astrocurrentlocale, #astrogetactionresult, #astrocallaction, #contexto-de-endpoint, #contextparams, #contextprops, #contextrequest, #contextcookies, #contexturl, #contextclientaddress, #contextsite, #contextgenerator, #contextredirect, #contextrewrite, #contextlocals, #contextgetactionresult, #contextcallaction, #getstaticpaths, #params, #passagem-de-dados-com-props, #paginate, #a-prop-page-da-paginação, #pagedata, #pagestart, #pageend, #pagesize, #pagetotal, #pagecurrentpage, #pagelastpage, #pageurlcurrent, #pageurlprev, #pageurlnext, #pageurlfirst, #pageurllast, #importmeta, #docsearch-lvl0, #issue1oqbvny, #idea1oqbvny, #other1oqbvny, #textarea1oqbvny
Loading