curl command in java

后端 未结 2 1628
梦毁少年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:49

    hey try this I had the same problem. It worked in my terminal had the same error as yours.

    String[] command = {"curl", "-u" , username+ ":" + password , url};
    
    0 讨论(0)
  • 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};
    
    0 讨论(0)
提交回复
热议问题