Android에서 retrofit2 REST api coord2address api 헤더 cannot find Authrization 이슈 도와주세요

android에서 retrofit2를 사용하여 REST api 통신을 하려고 합니다.

retrofit interface 구현은 다음과 같이 했습니다:

@Headers("Authorization: KakaoAK ***************************")
@GET("v2/local/geo/coord2address.json")
Call<JsonObject> getLocationInfo(@QueryMap HashMap<String,Double> params);

다른 클래스에서 다음과 같이 불러오도록 했습니다.
Retrofit retrofit = new Retrofit.Builder()
.baseUrl(“https://dapi.kakao.com/”)
.addConverterFactory(GsonConverterFactory.create())
.build();
RetrofitInterface retrofitInterface = retrofit.create(RetrofitInterface.class);

public LocationData requestLocation(double longitude, double latitude) throws IOException {
    HashMap<String, Double> paramMap = new HashMap<>();
    paramMap.put("x", longitude);
    paramMap.put("y", latitude);
    Response<JsonObject> call = retrofitInterface.getLocationInfo(paramMap).execute();

서버 통신까지는 잘 됩니다. 그런데
{“errorType”:“AccessDeniedError”,“message”:“cannot find Authorization : KakaoAK header”}
이런 메시지가 뜨면서 정상적인 응답을 받지 못하고 있습니다.
REST api 키로 제대로 넣었고, 자바스크립트 키를 넣어보면 다른 에러메시지가 나오는 등 헤더로 잘 인식하는 것 같은데 왜 이런 에러가 뜰까요?

1개의 좋아요