Alright friends, let's walk through the solutions in.
So the very first thing I asked you to do was to name a tool that you could use
to send
HTTP requests to this new REST API server.
The solution I would suggest is the one that we saw at the end of this skill
and this
is the postman utility, although I will say that you do not have to use postman
, there
are other tools out there.
And in fact you can just use regular programming languages, say for example,
using Python
to make the same type of requests.
But for testing the ability to save your request and so on and so forth in a WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
But for testing the ability to save your request and so on and so forth in a
neat nice way,
postman is a very, very good option.
Okay, so next question you wish to read a list of all the user names stored on
the server.
However, the server is not accessible to the general public, which key factors
do we have
to consider right here?
So the first thing to state here is that if we want to read a list of all the
user names
stored on the server, we're going to have to make a note of the particular URL
that we
want that we can target a very particular resource on the server, namely the
list of all
the user names.
Now, what would we also want to consider?
Well, maybe we want to specify the type of formatting we should expect back. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Well, maybe we want to specify the type of formatting we should expect back.
So we might actually craft and accept header, but that is a little bit further
down on
the priorities.
What I'm most concerned about is the fact that this server is not accessible to
the general
public.
This indicates to me that we're going to have to have some type of
authorization to
access it.
So as such, what I want to do is I want to make sure that I actually have my
authorization
header in play and I do actually have the correct credentials.
Now what else do I want to think about?
Once I get the resource and I have my headers in play, then I would also like WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Once I get the resource and I have my headers in play, then I would also like
to make sure
that I'm sending the correct HTTP method.
So in my case here, I want to be sending a get request.
Now, if I happen to do this, then what I should see is a successful response.
Now if all of this happens to be successful, which we hope it would be, which
status code
would I actually expect to receive?
Well, if we send a get request and I happen to be successful, then what I would
expect
to see would be a 200 status code, aka an OK response.
All right.
So now you wish to add some test data to do so. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So now you wish to add some test data to do so.
You attempt to add a test user name into the data set, which modifications will
you need
to make in order for the request to be successful.
So first thing here, I'm going to have to change the get request to be a post
request
in this case.
Since I'm going to be inserting data, I'm going to also specify my content type
header
so the server can know what to expect.
I'm also going to supply the actual content that I'm trying to add within the
body of the
actual request.
As we saw in the video, when we utilize postman, and also we want to ensure WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
As we saw in the video, when we utilize postman, and also we want to ensure
that we're using
the correct URL in order to insert new data into the data set.
So assuming we have a success, which status code would we expect to see?
Well, this time we should actually see a two or one status code indicating that
a new
resource was indeed created.
So friends, that is us for our validation challenge on REST APIs.
I hope it's been fun for you and I'd like to thank you for viewing.