mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-03-28 21:16:20 +01:00
Invoke-WebRequest: add Spanish translation (#15254)
Co-authored-by: Darío Hereñú <magallania@gmail.com>
This commit is contained in:
parent
f2766e9949
commit
1742028141
1 changed files with 25 additions and 0 deletions
25
pages.es/windows/invoke-webrequest.md
Normal file
25
pages.es/windows/invoke-webrequest.md
Normal file
|
@ -0,0 +1,25 @@
|
|||
# Invoke-WebRequest
|
||||
|
||||
> Realiza una solicitud HTTP/HTTPS a la Web.
|
||||
> Nota: Este comando solo se puede utilizar a través de PowerShell.
|
||||
> Más información: <https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/invoke-webrequest>.
|
||||
|
||||
- Descarga el contenido de una URL a un archivo:
|
||||
|
||||
`Invoke-WebRequest {{http://example.com}} -OutFile {{ruta\al\archivo}}`
|
||||
|
||||
- Envía datos codificados para formularios (solicitud POST de tipo `application/x-www-form-urlencoded`):
|
||||
|
||||
`Invoke-WebRequest -Method Post -Body @{ name='roberto' } {{http://example.com/form}}`
|
||||
|
||||
- Envía una solicitud con un encabezado adicional, utilizando un método HTTP personalizado:
|
||||
|
||||
`Invoke-WebRequest -Headers {{@{ X-My-Header = '123' }}} -Method {{PUT}} {{http://example.com}}`
|
||||
|
||||
- Envía datos en formato JSON, especificando el encabezado tipo de contenido (content-type) adecuado:
|
||||
|
||||
`Invoke-WebRequest -Body {{'{"name":"bob"}'}} -ContentType 'application/json' {{http://example.com/users/1234}}`
|
||||
|
||||
- Pasa un nombre de usuario y contraseña para autenticación ante el servidor:
|
||||
|
||||
`Invoke-WebRequest -Headers @{ Authorization = "Basic "+ [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes("myusername:mypassword")) } {{http://example.com}}`
|
Loading…
Add table
Reference in a new issue