So let's now talk about these HTTP methods.
So essentially, like I said previously, the HTTP method is going to allow us to
specify
what type of operation we want to have on our server.
So what type of things are we talking about here?
Well, the first thing to note is that we actually have a very specific acronym
related to these particular actions.
And that is the crud acronym.
So let's talk about what each of them happens to be and we will associate them
with their HTTP method.
So the very first one is C, which is correlating with the creation of a WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So the very first one is C, which is correlating with the creation of a
particular resource.
So that would be if on your server a particular resource did not exist at all
and you wanted to create it absolutely afresh,
then this is the type of operation that we are talking about right here.
So remember in the previous video, we talked about the ability to create a new
message in our web ex server.
Well, this is a type of thing we're talking about here.
We're talking about the creation of something new, a brand new message that did
not exist before.
So that could be one type of operation.
The next one is the ability to read from the server. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
The next one is the ability to read from the server.
So that would be to actually pull information from the server that already
exists.
So again, to go back to the web ex example, let's imagine we have created a
whole bunch of messages on our server.
So now they actually exist.
They have been written into the actual server itself.
And if we wanted to read or retrieve already existing information,
then we could simply perform a read operation to say, for example, read those
previously created messages. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
previously created messages.
That would be one form.
Now let's suppose there was a resource on our server, whatever it may be,
maybe it's some type of record in a database could be a name, a location,
whatever it is.
Let's maybe say you wanted to update that information.
Well, we could do some type of update operation.
And similarly, let's maybe say we wanted to remove a particular resource from
our server,
then indeed we could perform a delete operation.
So these are the actual operations which we can use in our rest applications.
But these are not the actual HTTP methods used to perform these operations. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
But these are not the actual HTTP methods used to perform these operations.
Let's talk about them.
So as I just said here, we have our crud acronym for creating,
reading, updating and deleting resources.
Let's go top to bottom and specify the method we would use to get that
particular result.
So if we want to create a resource, what do we do?
We specify what is known as an HTTP post request.
Whereas if we want to say, for example, read from a server, what do we do?
We this time send a get request to get information from our server. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
We this time send a get request to get information from our server.
Now, whether we want to update a particular resource,
we can use two particular methods.
We can specify a put request or alternatively, we can specify a patch request.
The difference is really just in the implementation, a put request,
specifies that we should pass in all the data needed.
That is all of the information that we are attempting to replace.
Whereas a patch request allows us to specify partial information,
just to update a very specific part of that data.
And finally, the one that's the easiest to remember, WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And finally, the one that's the easiest to remember,
to perform a delete operation, the type of HTTP method we use,
is indeed a delete request.
So these are our main HTTP operations.
And in fact, if we go back to the documentation for Cisco WebEx,
say, for example, let's go back to messages one more time.
Look at this right here, okay?
You may notice some information that you might not have paid attention
to the first time you saw it.
Let's say, for example, we want to create a message,
what do we actually do?
Well, we target this particular endpoint here using this URL. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Well, we target this particular endpoint here using this URL.
But we have to specify a particular HTTP method with it, see this right here,
to create a resource, we have to use a post request.
Whereas if you want to edit a message,
I.e. update an already existing message,
what do we do? We target this particular URL.
And this time we don't send a post request, we send a put request
to effectively update that resource, make a change to it,
one that already exists.
Whereas say, for example, you want to retrieve information,
such as get a list of all the messages, what can we do? WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
such as get a list of all the messages, what can we do?
We can target this particular URL.
And then the HTTP method we use is a get request,
whereas if you want to read all the information about direct messages,
we use a different URL, which will target a different resource,
a more specific one, in this case here, just direct messages.
But again, we still use the same method.
And that's because the same thing is happening,
we're trying to read information from our servers, albeit,
but just trying to read different things,
different resources specified by different URLs.
And of course, again, if you want to, like I said, delete. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And of course, again, if you want to, like I said, delete.
In this example here, a message, this here would be the URL we would use.
And the HTTP method is going to be the delete method.
And this here is basically how the rest architecture works.
We use these methods and conjunction with these resources.
And ultimately, we can dictate the type of communication
that we want with our server.