无效的API凭证

时间:2019-02-22 06:47:40

标签: java android

我现在可以连接到我的API了,但是不知何故,它告诉我“ Invalid API Creadentials”我确实执行了addHeader但它没有传递给api

 RequestParams p = new RequestParams();
    p.add("Username","asd");
    p.add("Password","asdqwe");

    SISOB_APIURL = "http://services.lbcexpress.com/sisob/api/Values?";
    client = new AsyncHttpClient();
    client.addHeader("API_KEY","HESOYAM");
    client.addHeader("API_SECRET","BAGUVIX");
    client.get(this,SISOB_APIURL,p, new JsonHttpResponseHandler(){
        @Override
        public void onSuccess(int statusCode, Header[] headers, JSONArray response) {
            super.onSuccess(statusCode, headers, response);
            Toast.makeText(MenuActivity.this, response.toString(), Toast.LENGTH_LONG).show();
        }

        @Override
        public void onFailure(int statusCode, Header[] headers, String responseString, Throwable throwable) {
            super.onFailure(statusCode, headers, responseString, throwable);
            Toast.makeText(MenuActivity.this, responseString.toString(), Toast.LENGTH_LONG).show();
        }
    });

1 个答案:

答案 0 :(得分:0)

感谢回答我,我的问题是键名 现在可以了,

int func()
int a = 42;