OTCS REST API - Document Uplaod is giving 500 Internal Server error

Hi I am using the below code for upload a document in content server using restapi.I am getting 500 Internal Sever error while uplaoding.
iurl5 = new URL(ConstantValues.baseUrl+"/api/v1/nodes/");
HttpURLConnection uc5 = (HttpURLConnection)iurl5.openConnection();
uc5.setRequestMethod("POST");
uc5.setRequestProperty("otcsticket",info.getAuthToken());
uc5.setRequestProperty("type","144");
uc5.setRequestProperty("parent_id","2000");
uc5.setRequestProperty("name","Test");
uc5.setDoInput(true);
uc5.setDoOutput(true);
uc5.getOutputStream().write(byteArray);
uc5.connect();
String response = uc5.getResponseMessage();

Tagged:

Comments