curl command in java

后端 未结 2 1629
梦毁少年i
梦毁少年i 2020-12-28 16:12

First of all , i\'ve already seen couple of documents, stackoverflow questions regarding the same ..I\'ve my project specific question When trying to run command :



        
2条回答
  •  孤独总比滥情好
    2020-12-28 16:52

    Try changing this line

    String[] command = {"curl", "-u" ,"Accept:application/json", username, ":" , password , url};
    

    into

    String[] command = {"curl", "-H", "Accept:application/json", "-u", username+":"+password , url};
    

提交回复
热议问题