Yelp-Android InvalidSignature异常

时间:2017-02-08 16:37:37

标签: android api retrofit retrofit2 yelp

我正在按照GitHub上的自述文件中的步骤来访问Yelp Search API:pseudo selectors但它产生了以下错误,我不确定为什么我的oauth_signature请求无效:< / p>

    YelpAPIFactory apiFactory = new YelpAPIFactory(Constants.YELP_CONSUMER_KEY, Constants.YELP_CONSUMER_SECRET, Constants.YELP_TOKEN, Constants.YELP_TOKEN_SECRET);
    YelpAPI yelpAPI = apiFactory.createAPI();

    Map<String, String> params = new HashMap<>();

    // general params
    params.put("limit", "10");
    params.put("radius_filter","16094");
    params.put("cll", latitude + "," + longitude);

    final Call<SearchResponse> yelpDataCall = yelpAPI.search(getCity(latitude,longitude), params);

    yelpDataCall.enqueue(new Callback<SearchResponse>() {
        @Override
        public void onResponse(Call<SearchResponse> call, Response<SearchResponse> response) {
            int statusCode = response.code();
            SearchResponse yelpData = response.body();
            Timber.d("Response status code: " + statusCode + " - " + response.message());
            Timber.d("GET <-- " + call.request().url().toString());
        }

        @Override
        public void onFailure(Call<SearchResponse> call, Throwable t) {
            Timber.d("Response error code: " + t.toString());
            Timber.d("GET <-- " + call.request().url().toString());
        }
    });

我没有在建议的设置之外做任何特别的事情:

scope :search_provider, ->(search) {
 scope = where('TRUE')
 if search['organisation'].present?
   scope = scope.where({ :some_condition => :some_value })
 end
 if search['website'].present?
   scope = scope.where({ :some_condition => :some_value })
 end
 scope
}

真正奇怪的是,这个确切的代码只是在昨天工作。我已经尝试过同步和异步设置调用,并且两者都产生相同的异常。

0 个答案:

没有答案