HTTP
Advanced curl Usage
· β˜• 1 min read
1. RESTful Requests 1 curl -X POST --data 'keyword=value' http://domain.com/mypath/ After -X you can also use DELETE, PUT, and so on. 2. Adding Headers 1 curl -H 'Content-Type:application/json' -H 'Authorization: bearer MyToken' http://domain.com/mypath/ 3. Basic Authentication 1 curl -u username:password http://domain.com/mypath/ 4. Download and Execute 1 curl -sSL http://domain.com/my.sh | bash 5.

Content-Type in the HTTP Header
· β˜• 5 min read
1. HTTP Header The HTTP protocol is an application-layer specification built on top of TCP/IP, transmitted as ASCII text. The HTTP specification divides an HTTP request into three parts: the status line, the request headers, and the message body. Something like this: 1 2 3 4 5 <method><request-URL><version> <headers> <entity-body> An HTTP header falls into four categories: general headers, request headers, response headers, and entity headers.