图片搜索 API bing Retrofit 没有得到响应

Image Search API bing Retrofit not getting response

我是 retrofit.Image 搜索 API 的新手,收到空响应。虽然响应成功但它仍然 returns 为空。

这是查询key的搜索界面

public interface BingApiService {


@Headers("Ocp-Apim-Subscription-Key: *key*")
@GET("bing/v7.0/search")
Call<ImageSearch> getBingResponse(
         @Query("q") String q


);}

BingApiUtils

public class BingApiUtils {

private BingApiUtils() {
}

public static final String BASE_URL = "https://api.cognitive.microsoft.com/";

public static BingApiService getBingAPIService() {
    return BingRetrofitClient.getClient(BASE_URL).create(BingApiService.class);
}

}

getclient function

public class BingRetrofitClient {

private static Retrofit retrofit = null;

public static Retrofit getClient(String baseUrl) {
    if (retrofit == null) {
        retrofit = new Retrofit.Builder()
                .baseUrl(baseUrl)
                .addConverterFactory(GsonConverterFactory.create())
                .build();
    }
    return retrofit;
}

}

    bingApiService.getBingResponse("cat").enqueue(new Callback<ImageSearch>() {
        @Override
        public void onResponse(Call<ImageSearch> call, Response<ImageSearch> response) {

 // here I get the null response
        }

        @Override
        public void onFailure(Call<ImageSearch> call, Throwable t) {

        }
    });

图像搜索端点似乎不正确。应该是:https://api.cognitive.microsoft.com/bing/v7.0/images/search。您似乎在调用网络搜索 API 端点。