informatica:linux:curl
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
informatica:linux:curl [2011/03/14 11:36] – 83.247.136.12 | informatica:linux:curl [2020/05/29 16:44] – jose | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Post de un fichero | + | ====== Post con curl ====== |
- | En la web de validación de catcert subimos un certificado para validarlo: | + | Instalamos |
- | http:// | + | |
- | Exportamos nuestro certificado a un fichero certificado.txt. La petición es: | + | http://localhost: |
- | curl -F " | + | |
- | Sacamos el nombre de la variable de **Content-Disposition** | + | Pulsamos continue |
- | Content-Disposition: | + | |
- | Content-Type: application/ | + | |
- | Toda la petición con live http-headers es: | + | {{:informatica:linux: |
- | < | + | |
- | http:// | + | |
+ | Si hacemos click lo abre en otra ventana: | ||
+ | {{: | ||
- | POST / | ||
- | Host: testvalidacio.catcert.cat | + | Para simularlo, primero vamos a la primera web y guardamos la cookie |
- | User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; es-ES; rv:1.9.2.15) Gecko/20110303 Ubuntu/ | + | < |
+ | curl -A "User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 | ||
+ | -c cookie1 \ | ||
+ | -D header1 \ | ||
+ | -o page1.html \ | ||
+ | -L " | ||
+ | </ | ||
- | Accept: text/html, | + | < |
+ | curl -A " | ||
+ | -b cookie1 \ | ||
+ | -c cookie2 \ | ||
+ | -D header2 \ | ||
+ | -o page2.html \ | ||
+ | -X POST \ | ||
+ | -d " | ||
+ | -e " | ||
+ | -L " | ||
+ | </ | ||
- | Accept-Language: es-es,es;q=0.8,en-us;q=0.5,en;q=0.3 | + | < |
+ | curl -A "User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/ | ||
+ | -b cookie2 \ | ||
+ | -c cookie3 \ | ||
+ | -D header3 \ | ||
+ | -o page3.html \ | ||
+ | -X POST \ | ||
+ | -d " | ||
+ | -e " | ||
+ | -L " | ||
+ | </ | ||
- | Accept-Encoding: | ||
- | Accept-Charset: ISO-8859-1, | + | POST: |
+ | DBType=mysql& | ||
- | Keep-Alive: 115 | + | < |
+ | curl -A " | ||
+ | -b cookie3 \ | ||
+ | -c cookie4 \ | ||
+ | -D header4 \ | ||
+ | -o page4.html \ | ||
+ | -d " | ||
+ | -e " | ||
+ | -L " | ||
+ | </ | ||
- | Connection: keep-alive | + | POST: |
+ | mysql__SameAccount=1& | ||
- | Referer: http:// | + | < |
- | + | curl -A " | |
- | Cookie: JSESSIONID=FF1FA7290A9763D5666EAA41F28BCC96.app-linux3; __utma=207753728.979729517.1283506803.1283510321.1299841686.4; | + | |
- | + | | |
- | Content-Type: multipart/ | + | |
- | + | | |
- | Content-Length: 2301 | + | |
- | + | | |
- | -----------------------------19885389925490671952116794076 | + | |
- | + | ||
- | Content-Disposition: | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | -----------------------------19885389925490671952116794076 | + | |
- | + | ||
- | Content-Disposition: form-data; name="certFile"; | + | |
- | + | ||
- | Content-Type: application/octet-stream | + | |
- | + | ||
- | + | ||
- | + | ||
- | -----BEGIN CERTIFICATE----- | + | |
- | + | ||
- | MIIFQDCCBKmgAwIBAgIEPL7q0TANBgkqhkiG9w0BAQUFADA2MQswCQYDVQQGEwJF | + | |
- | + | ||
- | nl5zfYDAJMWIE8hALMzH1DkSHW1UCbL1kVUNZQNhLmzqohsi1jIFTu691hkSJ/6C | + | |
- | + | ||
- | qYf91A== | + | |
- | + | ||
- | -----END CERTIFICATE----- | + | |
- | + | ||
- | + | ||
- | + | ||
- | -----------------------------19885389925490671952116794076-- | + | |
- | + | ||
- | + | ||
- | + | ||
- | HTTP/1.1 200 OK | + | |
- | + | ||
- | Date: Mon, 14 Mar 2011 10:38:53 GMT | + | |
- | + | ||
- | Content-Type: | + | |
- | + | ||
- | Content-Length: | + | |
- | + | ||
- | Connection: Keep-Alive | + | |
- | + | ||
- | ---------------------------------------------------------- | + | |
</ | </ | ||
- | |||
- | ====== Con Proxy ====== | ||
- | curl -x proxy: | ||
- |