Administración de Sistemas

PETICIONES GET:

Con JSON:

curl -i -H "Accept: application/json" -H "Content-Type: application/json" http://hostname/resource

Con  XML:

curl -H "Accept: application/xml" -H "Content-Type: application/xml" -X GET http://hostname/resource

 

PETICIONES POST

Para POST de parámetros

curl --data "param1=value1&param2=value2" http://hostname/resource

 

Para subida de ficheros:

curl --form "fileupload=@filename.txt" http://hostname/resource

 

RESTful HTTP Post:

curl -X POST -d @filename http://hostname/resource


Para loggear en una web (auth)

curl -d "username=admin&password=admin&submit=Login" --dump-header headers http://localhost/Login

curl -L -b headers http://localhost/

Published in Servidores