I was going through the list of REST API's for Azure Data Lake Storage Gen2 and facing problems when i call the api's from CLI/Postman.
i just started with simple get request path list api.
But response am getting as below
{"error":{"code":"InvalidHeaderValue","message":"The value for one of the HTTP headers is not in the correct format.\nRequestId:ecb96bb0-501f-0030-2578-65cf12000000\nTime:2020-07-29T07:20:35.6240747Z"}}
After searching found sample code to create directory/file and tried to create directory but got response like
Put Request
curl -i -X PUT -H "x-ms-version: 2020-07-29" -H "content-length: 0" -H "Authorization: Bearer $ACCESS_TOKEN" "https://$AccountName.dfs.core.windows.net/mydata?resource=filesystem"
Response for the above request
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 202 100 202 0 0 115 0 0:00:01 0:00:01 --:--:-- 115HTTP/1.1 400 The value
for one of the HTTP headers is not in the correct format.
Content-Length: 202
Content-Type: application/json;charset=utf-8
Server: Windows-Azure-HDFS/1.0 Microsoft-HTTPAPI/2.0
x-ms-request-id: 8d615c77-001f-0070-2b79-65c82a000000
Date: Wed, 29 Jul 2020 07:25:54 GMT
{"error":{"code":"InvalidHeaderValue","message":"The value for one of the HTTP headers is not in the correct format.\nRequestId:8d615c77-001f-0070-2b79-65c82a000000\nTime:2020-07-29T07:25:55.9048230Z"}}
For authentication i am using https://login.microsoftonline.com/{{tenantID}}/oauth2/token?
and then capturing the bearer token in Test section using this below code.
pm.test(pm.info.requestName, () => {
pm.response.to.not.be.error;
pm.response.to.not.have.jsonBody('error');
});
pm.globals.set("bearerToken", pm.response.json().access_token);
pm.test(pm.info.requestname, ()=>{
pm.response.to.not.be.error;
pm.response.to.not.have.jsonBody('error');
})
pm.globals.set('BearerToken',("Bearer ").concat(pm.response.json().access_token));
can anyone tell me where and what is going wrong?
Updating question as requested with Screenshots.
After doing so many trials figured outfilesystem-list i am getting response but for path-list getting error saying AuthorizationPermissionMismatch
with 403
status code.