curl -i -H "Accept: application/json" -H "Content-Type: application/json" http://hostname/resource
with XML:curl -H "Accept: application/xml" -H "Content-Type: application/xml" -X GET http://hostname/resource
POST:For posting data:
curl --data "param1=value1¶m2=value2" http://hostname/resource
For file upload:curl --form "fileupload=@filename.txt" http://hostname/resource
RESTful HTTP Post:curl -X POST -d @filename http://hostname/resource
For logging into a site (auth):curl -d "username=admin&password=admin&submit=Login" --dump-header headers http://localhost/Login
curl -L -b headers http://localhost/
HTTP Scripting
1.1 Background1.2 The HTTP Protocol
1.3 See the Protocol
1.4 See the Timing
1.5 See the Response
URL
2.1 Spec2.2 Host
2.3 Port number
2.4 User name and password
2.5 Path part
Fetch a page
3.1 GET3.2 HEAD
HTML forms
4.1 Forms explained4.2 GET
4.3 POST
4.4 File Upload POST
4.5 Hidden Fields
4.6 Figure Out What A POST Looks Like
HTTP upload
5.1 PUTHTTP Authentication
6.1 Basic Authentication6.2 Other Authentication
6.3 Proxy Authentication
6.4 Hiding credentials
More HTTP Headers
7.1 Referer7.2 User Agent
Redirects
8.1 Location header8.2 Other redirects
Cookies
9.1 Cookie Basics9.2 Cookie options
HTTPS
10.1 HTTPS is HTTP secure10.2 Certificates
Custom Request Elements
11.1 Modify method and headers11.2 More on changed methods
Web Login
12.1 Some login tricksDebug
13.1 Some debug tricksReferences
14.1 Standards14.2 Sites
No hay comentarios:
Publicar un comentario