0
REST güvenilenini kullanarak REST post url'mizi yürütemiyorum. 404 hatası alıyorum. Bizim REST url herhangi bir kimlik doğrulama, vücut vb. Gerektirmez. Aynı url POSTMAN, RESTEasy iyi çalışır. BenREST Post isteği gönderilemiyor REST Assured
@Test
public void httpPost() throws JSONException,InterruptedException {
//Initializing Rest API's URL
String APIUrl = "http://xyz:8080/jbpm-console/rest/runtime/317002:31702Project:0.0.5-SNAPSHOT/process/317002Project.ScriptTask/start?superUser=cw-user";
RequestSpecBuilder builder = new RequestSpecBuilder();
builder.setContentType("application/json;charset=UTF-8");
RequestSpecification requestSpec = builder.build();
//Response response = given().spec(requestSpec).when().post(APIUrl);
//Response response= given().contentType("application/json").when().post(APIUrl);
Response response = given().authentication().preemptive().basic("", "").spec(requestSpec).when().post(APIUrl);
//Response response= expect().contentType("application/json;charset=UTF-8").statusCode(200).when().post(APIUrl);
JSONObject JSONResponseBody = new JSONObject(response.body().asString());
System.out.println(JSONResponseBody);
}
Tipik cevaplar Cevabınız bir açıklama eklerseniz anlamak için daha iyi alınan ve daha kolay yanıt almak için dört kombinasyonu denedim. Teşekkürler! – JoelC