curl get post 请求总结

get请求

《1》传入参数的get请求

 curl -X GET "localhost:8080/api/job/list?order=desc&limit=10&offset=0&status=success"

Post 请求

《2》post请求传入json body值

  curl -X POST "localhost:8080/job/register" -H 'Content-Type: application/json' -d'
{
  "name": "TestSparkPiTask",
  "jobType": "batch",
  "status": "active",
  "mainClass": "org.apache.spark.examples.SparkPi",
  "args": [
    "10",
    "1"
  ],
  "trigger": {
    "time": "2020-02-13 20:58:00 Thursday",
    "repeat": "perWeek"
  },
  "runtime": {
    "resource": {
      "jarName": "spark-examples_2.11-2.4.4.jar"
    }
  },
  "engine": {
    "type": "spark",
    "config": {
      "entry": [
        {
          "key": "spark.executor.instances",
          "value": "3"
        },
        {
          "key": "spark.executor.cores",
          "value": "3"
        },
        {
          "key": "spark.executor.memory",
          "value": "2g"
        },
        {
          "key": "spark.driver.memory",
          "value": "1g"
        }
      ]
    }
  }
}
'            

《3》post请求设置简单的param

  curl -X POST "localhost:8080/api/job/activate" -d 'job_id=5'
发布了25 篇原创文章 · 获赞 0 · 访问量 439

猜你喜欢

转载自blog.csdn.net/m0_38028438/article/details/104327657