nullToken范围未设置。此请求没有所需的权限

时间:2017-09-11 09:29:14

标签: android token bucket

在使用Autodesk的AndroidSDK时,成功获得了令牌;但在Create Bucket,意外返回“nullToken范围未设置。此请求没有所需的权限。“ 代码:

HttpPost request = new HttpPost(BASEUrl+ upload_srv);
request.addHeader("Content-Type", "application/json");

//v2 changed the param name from 'policy' to 'policyKey'
String jsonstr  ="{\"bucketKey\":\""+ newBucketName + "\", \"servicesAllowed\":{}, \"policyKey\":\"temporary\"}";
HttpEntity jsonent = new StringEntity(jsonstr,HTTP.UTF_8);
request.setEntity(jsonent);

HttpClient httpclient =  getNewHttpClient();
HttpContext localContext = new BasicHttpContext();

localContext.setAttribute(ClientContext.COOKIE_STORE, globalcookies);

HttpResponse response = httpclient.execute(request,localContext);

0 个答案:

没有答案