How do I POST JSON data with cURL?

后端 未结 24 2590
刺人心
刺人心 2020-11-21 23:56

I use Ubuntu and installed cURL on it. I want to test my Spring REST application with cURL. I wrote my POST code at the Java side. However, I want to test it with cURL. I am

24条回答
  •  忘了有多久
    2020-11-22 00:44

    Here is another way to do it, if you have dynamic data to be included.

    #!/bin/bash
    
    version=$1
    text=$2
    branch=$(git rev-parse --abbrev-ref HEAD)
    repo_full_name=$(git config --get remote.origin.url | sed 's/.*:\/\/github.com\///;s/.git$//')
    token=$(git config --global github.token)
    
    generate_post_data()
    {
      cat <

提交回复
热议问题