HTTP request:

  1. request method (POST, GET, HEAD, PUT ...)
  2. request header
  3. request body(content)

method + header:

POST http://www.example.com HTTP/1.1
Content-Type:multipart/form-data; boundary=----WebKitFormBoundaryrGKCBY7qhFd3TrwA

body:

------WebKitFormBoundaryrGKCBY7qhFd3TrwA
Content-Disposition: form-data; name="images"; filename="1.jpg"
Content-Type: image/jpg

 ... content of 1.jpg ...
------WebKitFormBoundaryrGKCBY7qhFd3TrwA
Content-Disposition: form-data; name="images"; filename="2.png"
Content-Type: image/png

 ... content of 2.png ...
------WebKitFormBoundaryrGKCBY7qhFd3TrwA--

参考网址: HTTP 表单编码 enctype

HTTP response

  1. response status (200 OK, 400 Bad Request, 403 Forbidden ...)
  2. response header
  3. response body(content) (html, xml ...)

参考网址: HTTP-请求/响应/缓存

MIME Type

Ubuntu Apache配置以及cgi配置方法

参考网址: