0

This question already has an answer here:

How do you get Access Token using REST?

I'm trying to upload a folder in my Document Library using REST but it requires a Access Token in the header.

Here is the code:

 public void createFolder(String digest) throws ClientProtocolException, IOException {
    HttpPost request = new HttpPost(
            "http://industrial-ex/sites/tifdemo/_api/Web/Folders/add('enovia/newfolder')");

    request.addHeader("Content-Type", "application/json;odata=verbose");
    request.addHeader("X-RequestDigest", digest);
    CloseableHttpResponse response = httpClient.execute(target, request, context);
    response.setHeader("Accept", "application/json;odata=verbose");
    System.out.println("STATUS CODE Post Folder: " + response.getStatusLine());

}

Thanks in advance

merged by Benny Skogberg Mar 26 '15 at 11:52

This question was merged with Upload a file to folder in a document libary because it is an exact duplicate of that question.