zoukankan      html  css  js  c++  java
  • curl的用法

    GET请求

    curl http://localhost:8888/mock/api

    POST请求(-X可以省略,-d默认就是POST参数)

    curl -X POST -d '{"name":"api1","content":"api1 conent","method":"get","url":"/users"}' -H 'Content-Type: application/json' http://localhost:8888/mock/api

    PUT请求

    curl -X PUT -d '{"name":"api1","content":"api1 conent","method":"get","url":"/users"}' -H 'Content-Type: application/json' http://localhost:8888/mock/api

    DELETE请求

    curl -X DELETE -d '{"name":"api1","content":"api1 conent","method":"get","url":"/users"}' -H 'Content-Type: application/json' http://localhost:8888/mock/api

    携带Cookie

    curl -b 'userId=xxx;name=xxx' https://mock/api1
    
    //从本地cookie文件读取cookie
    curl -b cookies.txt https://mock/api1

  • 相关阅读:
    快速创建ssm项目
    String 的基础知识点梳理一
    消息中间件ActiveMQ
    log4j.properties
    数据库基础
    pycharm快捷键
    HTML其他标签
    HTML基本标签
    概率论基础2
    概率论基础1
  • 原文地址:https://www.cnblogs.com/mengff/p/12690893.html
Copyright © 2011-2022 走看看