bing-api

Bing Search API Azure Marketplace Authentication in Java

给你一囗甜甜゛ 提交于 2019-11-27 07:00:08
问题 How can I authenticate in Java to use the new bing search api from Azure Marketplace?The migration guide does not provide you with info about Java 回答1: You'll need to encode your accountKey to Base64 and pass it to each request using the Authorization header. String bingUrl = "https://api.datamarket.azure.com/Bing/Search/................"; String accountKey = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="; byte[] accountKeyBytes = Base64.encodeBase64((accountKey + ":" + accountKey).getBytes());