Skip to content

Commit

Permalink
Merge pull request #633 from gautamdsheth/bugfix/bing-API-Issue
Browse files Browse the repository at this point in the history
Fix Bing API search issue
  • Loading branch information
AJIXuMuK authored Aug 14, 2020
2 parents 6871613 + c960b31 commit 3624856
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/services/FilesSearchService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,9 @@ export class FilesSearchService {
}

// Submit the request
const apiUrl: string = `https://api.cognitive.microsoft.com/bing/v7.0/images/search?traffictype=Internal_monitor&q=${encodeURIComponent(query)}&count=${maxResults}&aspect=${aspect}&maxFileSize=${maxFileSize}&mkt=en-US&size=${size}&license=${license}`;
const headers = new Headers({
'Ocp-Apim-Subscription-Key': this.bingAPIKey
});
const searchDataResponse: any = await this.context.httpClient.get(apiUrl, SPHttpClient.configurations.v1, {
headers: headers,
const apiUrl: string = `https://www.bingapis.com/api/v7/images/search?appid=${this.bingAPIKey}&traffictype=Internal_monitor&q=${encodeURIComponent(query)}&count=${maxResults}&aspect=${aspect}&maxFileSize=${maxFileSize}&size=${size}&mkt=en-US&license=${license}`;

const searchDataResponse: any = await this.context.httpClient.get(apiUrl, SPHttpClient.configurations.v1, {
method: 'GET',
mode: 'cors'
});
Expand Down

0 comments on commit 3624856

Please sign in to comment.