Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAaron Selonke
10,323 PointsHow did she know we only needed the URL string and the key to perform the request?
In the video the Bing API example request looks like this
""
GET https://api.cognitive.microsoft.com/bing/v5.0/news/search?q=sailing+dinghies&mkt=en-us HTTP/1.1
Ocp-Apim-Subscription-Key: 123456789ABCDE
User-Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 822)
X-Search-ClientIP: 999.999.999.999
X-MSEdge-ClientID: <blobFromPriorResponseGoesHere>
Host: bingapis.azure-api.net
Carling, says that we only need the URL string and the key. How did she know that? Without the video I might have been poking around at the docs for an hour before knowing where to begin..
Also, as a followup question This API is using a GET request... When we are working with Webclient does it matter if the APIs we is are making a GET or POST?
1 Answer
Jeremy McLain
Treehouse Guest TeacherIt sometimes takes a bit to become familiar with documentation. Also Cognitive API is just one API of many in Bing. They all work on the same principles. I'd read more about the Bing APIs in general.
Yes. POST and GET are two different verbs and it almost always matters which one you use.