【问题标题】:how to connect apigee proxy (Oauth verify) by using apigee android sdk?如何使用 apigee android sdk 连接 apigee 代理(Oauth 验证)?
【发布时间】:2014-03-17 06:45:48
【问题描述】:

我想在 android 应用中使用 apigee android sdk。通过使用 android sdk,我想连接 apigee 端点代理,但 api 代理已获得 Oauth 2.0 验证。如何访问我们的代理?


//Create client entity
String ORGNAME = "your-org";
String APPNAME = "your-app";        
ApigeeClient apigeeClient = new ApigeeClient(ORGNAME,APPNAME);
DataClient dataClient = apigeeClient.getDataClient();

String type = "item"; //entity type to be retrieved
Map queryString =  null; //we don't need any additional query parameters, in this case

//call getCollectionAsync to initiate the asynchronous API call    
dataClient.getCollectionAsync(type, queryString, new ApiResponseCallback() {    

//If getEntitiesAsync fails, catch the error
    @Override
    public void onException(Exception e) { 
        // Error
    }

    //If getCollectionAsync is successful, handle the response object
    @Override
    public void onResponse(ApiResponse response) {
        try { 
            if (response != null) {
                // Success
            }
        } catch (Exception e) { //The API request returned an error
                // Fail
        }
    }
}); 


【问题讨论】:

    标签: android api proxy apigee


    【解决方案1】:

    Android SDK 目前不支持 OAuth。

    【讨论】:

      猜你喜欢
      • 2015-08-12
      • 2014-03-14
      • 2014-10-12
      • 1970-01-01
      • 2014-07-05
      • 2014-03-25
      • 2020-12-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多