So the format of this is quite similar, and this time you can see,
again, we're encoding the search terms and locations using that.
And we use those values to build up the request string.
And then we can go down and take a look at the request.
This time we're using the get method on this request, so
we don't actually have to set it, it's by default.
But we do have to add the access token as an HTTP header field.
If I go in here and look at add value, it's like a key value, you add a value for
the field name.
And I think this is incorrect here, I'm just going to fix that.
According to documentation, we need to set it to the authorization, and
field names, that's where the name of the field goes,and this is
where the value goes here.
So we've added a value to that.
And then again, we use that request to create a data task.
And once that is sent off,
it should return back the results of the search which are in JSON format.
And then we convert that into a Swift datatype which we can use to
access the actual value.
Okay, so that is how to create an HTTP request that you need to use to send off
to a server and how to populate many of the fields in that request.
If you want to learn how to turn an image into data that can be sent in the body
of an HTTP request for example.
You can take a look at the Microsoft cognitive services class that we also
included in the sample code, that shows you how to send an image back to
the server for analysis using the HTTP body part of the request.