zoukankan      html  css  js  c++  java
  • curl 的简单使用

    ref:https://gist.github.com/subfuzion/08c5d85437d5d4f00e58

    curl usage

    For sending data with POST and PUT requests, these are common curl options:

    • request type

      • -X POST
      • -X PUT
    • content type header

    • -H "Content-Type: application/x-www-form-urlencoded"

    • -H "Content-Type: application/json"

    • data

      • form urlencoded: -d "param1=value1&param2=value2" or -d @data.txt
      • json: -d '{"key1":"value1", "key2":"value2"}' or -d @data.json

     eg:

    curl -X POST -H "Content-Type: application/json" -d '{"text":"airship","channel_id":"CL2UK298B","user_name":"xinguo"}' ip_addr

    curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -d "text=airship&channel_id=CL2UK298B&user_name=xinguo" ip_addr

  • 相关阅读:
    bzoj1711
    bzoj1458
    bzoj1433
    hdu2732
    bzoj1066
    hdu3549
    poj1698
    [ZJOI2007]时态同步
    SA 学习笔记
    [LUOGU]2016 Sam数
  • 原文地址:https://www.cnblogs.com/GuoXinxin/p/11265626.html
Copyright © 2011-2022 走看看