informatica:linux:curl
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
informatica:linux:curl [2011/03/14 11:33] – 83.247.136.12 | informatica:linux:curl [2020/05/29 16:46] – 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 " | + | |
- | La petición con live http-headers | + | Pulsamos continue y nos fijamos en los POST de http headers: |
- | < | + | |
- | http:// | + | |
- | POST / | + | Si hacemos click lo abre en otra ventana: |
- | Host: testvalidacio.catcert.cat | ||
- | User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; es-ES; rv: | ||
- | Accept: text/html,application/ | + | Para simularlo, primero vamos a la primera web y guardamos la cookie |
- | 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/ | ||
+ | -c cookie1 \ | ||
+ | -D header1 \ | ||
+ | -o page1.html \ | ||
+ | -L " | ||
+ | </ | ||
- | Accept-Encoding: gzip, | + | < |
+ | curl -A " | ||
+ | -b cookie1 \ | ||
+ | -c cookie2 \ | ||
+ | -D header2 \ | ||
+ | -o page2.html \ | ||
+ | -X POST \ | ||
+ | -d " | ||
+ | -e " | ||
+ | -L " | ||
+ | </ | ||
- | Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 | + | < |
+ | curl -A " | ||
+ | -b cookie2 \ | ||
+ | -c cookie3 \ | ||
+ | -D header3 \ | ||
+ | -o page3.html \ | ||
+ | -X POST \ | ||
+ | -d " | ||
+ | -e " | ||
+ | -L " | ||
+ | </ | ||
- | Keep-Alive: 115 | ||
- | Connection: keep-alive | + | POST: |
+ | DBType=mysql& | ||
- | Referer: http://testvalidacio.catcert.cat/psiswebclient/verify/certificate/verifycertreq.jsp | + | < |
+ | curl -A " | ||
+ | -b cookie3 \ | ||
+ | -c cookie4 \ | ||
+ | -D header4 \ | ||
+ | -o page4.html \ | ||
+ | -d " | ||
+ | -e "http:// | ||
+ | -L " | ||
+ | </ | ||
- | Cookie: JSESSIONID=FF1FA7290A9763D5666EAA41F28BCC96.app-linux3; | + | POST: |
+ | mysql__SameAccount=1& | ||
- | Content-Type: multipart/form-data; boundary=---------------------------19885389925490671952116794076 | + | < |
- | + | curl -A " | |
- | Content-Length: 2301 | + | |
- | + | | |
- | -----------------------------19885389925490671952116794076 | + | |
- | + | | |
- | Content-Disposition: | + | |
- | + | | |
- | + | | |
- | + | ||
- | + | ||
- | + | ||
- | -----------------------------19885389925490671952116794076 | + | |
- | + | ||
- | Content-Disposition: | + | |
- | + | ||
- | 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: text/html; | + | |
- | + | ||
- | Content-Length: | + | |
- | + | ||
- | Connection: Keep-Alive | + | |
- | + | ||
- | ---------------------------------------------------------- | + | |
</ | </ | ||
- | |||
- | ====== Con Proxy ====== | ||
- | curl -x proxy: | ||
- |