zoukankan      html  css  js  c++  java
  • curl -d

        -d/--data <data>
                  (HTTP) Sends the specified data in a POST request to the HTTP server, in the same way that a browser does when a user has filled in an HTML form and  presses
                  the submit button. This will cause curl to pass the data to the server using the content-type application/x-www-form-urlencoded.  Compare to -F/--form.
    
                  -d/--data  is  the same as --data-ascii. To post data purely binary, you should instead use the --data-binary option. To URL-encode the value of a form field
                  you may use --data-urlencode.
    
                  If any of these options is used more than once on the same command line, the data pieces specified will be merged together with a separating &-symbol.  Thus,
                  using ’-d name=daniel -d skill=lousy’ would generate a post chunk that looks like ’name=daniel&skill=lousy’.
    
                  If  you  start the data with the letter @, the rest should be a file name to read the data from, or - if you want curl to read the data from stdin.  The con-
                  tents of the file must already be URL-encoded. Multiple files can also be specified. Posting data from a file named ’foobar’ would thus be done  with  --data
                  @foobar.
    
    
     (HTTP) 发送指定的数据以一个POST 请求到HTTP server,
    
    与用户填写一个HTML表单然后按下submit 按钮一样。
    
    这个会导致CURL 传递数据到服务器使用 content-type application/x-www-form-urlencoded.  
    
    
    -d/--data 是一样的和--data-ascii。 如果要请求二进制数据,你应该使用--data-binary option. 
    
    
    URL-encode 表单字段的值 
    
    
    如果那些选项是被使用多次在相同的命令行, 数据段会被合并使用一个分割符号&
    
    因此使用 ’-d name=daniel -d skill=lousy’  会生成一个post chunk 看起来像
     ’name=daniel&skill=lousy’.

  • 相关阅读:
    栈 队列 递归 算法的GO语言实现
    数组与链表算法
    树算法的GO语言实现
    排序算法的GO语言实现
    如何抵抗记忆的衰退
    C程序运行的背后(2)
    C程序运行的背后(1)
    Shell脚本:“syntax error:unexpected end of file”
    电线的粗细与电流的大小怎么算?电流的大小与电器的功率有什么关系? 如何根据电流的大小选择铜质电线的粗细
    Word2019发布文章到博客园
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13349582.html
Copyright © 2011-2022 走看看