关于curl:curl-X-request-command

-X, –request <command>

  1. curl 默认的http申请办法是GET。
  2. 通常状况下,你并不需要指定这个选项,他会通过其余命令推导进去。
  3. 应用这个选项来指定http的申请办法,其实没卵用,他并不会扭转curl命令的理论行为,你指定了GET,它并不一定应用GET办法发送申请。

今天上代码。

  1. (HTTP) Specifies a custom request method to use when communicating with the HTTP server.
  2. The specified request will be used instead of the method otherwise used (which defaults to GET).
  3. Read the HTTP 1.1 specification for details and explanations. Common additional HTTP requests include PUT and DELETE, but related technologies like WebDAV offers PROPFIND, COPY, MOVE and more.
  4. Normally you don’t need this option. All sorts of GET, HEAD, POST and PUT requests are rather invoked by using dedicated command line options.
  5. This option only changes the actual word used in the HTTP request, it does not alter the way curl behaves. So for example if you want to make a proper HEAD request, using -X HEAD will not suffice. You need to use the -I, –head option.
  6. (FTP) Specifies a custom FTP command to use instead of LIST when doing file lists with FTP.
  7. If this option is used several times, the last one will be used.

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理