Skip to content

Instantly share code, notes, and snippets.

@MoimHossain
Created September 19, 2019 19:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MoimHossain/34bacd46bff2c985f2d490fff6393730 to your computer and use it in GitHub Desktop.
Save MoimHossain/34bacd46bff2c985f2d490fff6393730 to your computer and use it in GitHub Desktop.
public async Task<bool> CreateDirectoryAsync(string fileSystemName, string fullPath)
{
var tokenInfo = await tokenProvider.GetAccessTokenV2EndpointAsync();
var jsonContent = new StringContent(string.Empty);
var headers = Statics.Http.DefaultRequestHeaders;
headers.Clear();
headers.Add("Authorization", $"Bearer {tokenInfo.access_token}");
headers.Add(API_VERSION_HEADER_NAME, API_VERSION_HEADER_VALUE);
var response = await Statics.Http.PutAsync($"{baseUri}{WebUtility.UrlEncode(fileSystemName)}{fullPath}?resource=directory", jsonContent);
return response.IsSuccessStatusCode;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment