I can't create job on jenkins using Unirest
File file= new File(mypathFileConfig);
HttpResponse<String> checkResult = Unirest.post("http://"+userNameJenkins+":"+tokenJenkins+"@"+UrlJenkins+"/createItem?name="+jobName)
.header("Content-Type", "application/xml")
.field("config", file)
.asString();
I found that to create the job i must use config.xml file but does't work. always have 400 error How to create jenkins job using config.xml & unirest from java project?