diff --git a/lib/sharepoint/client.rb b/lib/sharepoint/client.rb index 985f2b5..4313203 100644 --- a/lib/sharepoint/client.rb +++ b/lib/sharepoint/client.rb @@ -326,11 +326,11 @@ def create_folder(name, path, site_path = nil) path = path[1..-1] if path[0].eql?('/') url = uri_escape "#{url}GetFolderByServerRelativeUrl('#{path}')/Folders" easy = ethon_easy_json_requester - easy.headers = { + easy.headers = with_bearer_authentication_header({ 'accept' => 'application/json;odata=verbose', 'content-type' => 'application/json;odata=verbose', 'X-RequestDigest' => xrequest_digest(site_path) - } + }) payload = { '__metadata' => { 'type' => 'SP.Folder'