WEBVTT

1
00:00.000 --> 00:03.560
So let's now talk about these HTTP methods.

2
00:03.560 --> 00:07.840
So essentially, like I said previously, the HTTP method is going to allow us to

3
00:07.840 --> 00:08.700
specify

4
00:08.700 --> 00:12.480
what type of operation we want to have on our server.

5
00:12.480 --> 00:14.720
So what type of things are we talking about here?

6
00:14.720 --> 00:18.650
Well, the first thing to note is that we actually have a very specific acronym

7
00:18.650 --> 00:20.920
related to these particular actions.

8
00:20.920 --> 00:23.360
And that is the crud acronym.

9
00:23.360 --> 00:27.260
So let's talk about what each of them happens to be and we will associate them

10
00:27.260 --> 00:29.040
with their HTTP method.

11
00:29.040 --> 00:33.100
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

11
00:29.040 --> 00:33.100
So the very first one is C, which is correlating with the creation of a

12
00:33.100 --> 00:34.400
particular resource.

13
00:34.400 --> 00:38.890
So that would be if on your server a particular resource did not exist at all

14
00:38.890 --> 00:41.640
and you wanted to create it absolutely afresh,

15
00:41.640 --> 00:45.520
then this is the type of operation that we are talking about right here.

16
00:45.520 --> 00:48.730
So remember in the previous video, we talked about the ability to create a new

17
00:48.730 --> 00:50.760
message in our web ex server.

18
00:50.760 --> 00:52.640
Well, this is a type of thing we're talking about here.

19
00:52.640 --> 00:56.460
We're talking about the creation of something new, a brand new message that did

20
00:56.460 --> 00:57.520
not exist before.

21
00:57.520 --> 00:59.680
So that could be one type of operation.

22
00:59.680 --> 01:04.080
The next one is the ability to read from the server.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

22
00:59.680 --> 01:04.080
The next one is the ability to read from the server.

23
01:04.080 --> 01:08.900
So that would be to actually pull information from the server that already

24
01:08.900 --> 01:09.680
exists.

25
01:09.680 --> 01:13.820
So again, to go back to the web ex example, let's imagine we have created a

26
01:13.820 --> 01:15.760
whole bunch of messages on our server.

27
01:15.760 --> 01:17.080
So now they actually exist.

28
01:17.080 --> 01:20.040
They have been written into the actual server itself.

29
01:20.040 --> 01:24.880
And if we wanted to read or retrieve already existing information,

30
01:24.880 --> 01:29.040
then we could simply perform a read operation to say, for example, read those

31
01:29.040 --> 01:30.880
previously created messages.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

31
01:29.040 --> 01:30.880
previously created messages.

32
01:30.880 --> 01:32.360
That would be one form.

33
01:32.360 --> 01:36.280
Now let's suppose there was a resource on our server, whatever it may be,

34
01:36.280 --> 01:39.800
maybe it's some type of record in a database could be a name, a location,

35
01:39.800 --> 01:40.640
whatever it is.

36
01:40.640 --> 01:44.120
Let's maybe say you wanted to update that information.

37
01:44.120 --> 01:46.840
Well, we could do some type of update operation.

38
01:46.840 --> 01:51.020
And similarly, let's maybe say we wanted to remove a particular resource from

39
01:51.020 --> 01:51.640
our server,

40
01:51.640 --> 01:54.480
then indeed we could perform a delete operation.

41
01:54.480 --> 01:58.680
So these are the actual operations which we can use in our rest applications.

42
01:58.680 --> 02:03.360
But these are not the actual HTTP methods used to perform these operations.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

42
01:58.680 --> 02:03.360
But these are not the actual HTTP methods used to perform these operations.

43
02:03.360 --> 02:04.240
Let's talk about them.

44
02:04.240 --> 02:07.320
So as I just said here, we have our crud acronym for creating,

45
02:07.320 --> 02:09.840
reading, updating and deleting resources.

46
02:09.840 --> 02:13.500
Let's go top to bottom and specify the method we would use to get that

47
02:13.500 --> 02:15.160
particular result.

48
02:15.160 --> 02:18.440
So if we want to create a resource, what do we do?

49
02:18.440 --> 02:22.000
We specify what is known as an HTTP post request.

50
02:22.000 --> 02:26.720
Whereas if we want to say, for example, read from a server, what do we do?

51
02:26.720 --> 02:31.760
We this time send a get request to get information from our server.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

51
02:26.720 --> 02:31.760
We this time send a get request to get information from our server.

52
02:31.760 --> 02:35.400
Now, whether we want to update a particular resource,

53
02:35.400 --> 02:37.040
we can use two particular methods.

54
02:37.040 --> 02:42.160
We can specify a put request or alternatively, we can specify a patch request.

55
02:42.160 --> 02:45.360
The difference is really just in the implementation, a put request,

56
02:45.360 --> 02:48.160
specifies that we should pass in all the data needed.

57
02:48.160 --> 02:51.720
That is all of the information that we are attempting to replace.

58
02:51.720 --> 02:55.000
Whereas a patch request allows us to specify partial information,

59
02:55.000 --> 02:57.880
just to update a very specific part of that data.

60
02:57.880 --> 03:01.080
And finally, the one that's the easiest to remember,
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

60
02:57.880 --> 03:01.080
And finally, the one that's the easiest to remember,

61
03:01.080 --> 03:04.960
to perform a delete operation, the type of HTTP method we use,

62
03:04.960 --> 03:07.400
is indeed a delete request.

63
03:07.400 --> 03:09.920
So these are our main HTTP operations.

64
03:09.920 --> 03:14.200
And in fact, if we go back to the documentation for Cisco WebEx,

65
03:14.200 --> 03:16.920
say, for example, let's go back to messages one more time.

66
03:16.920 --> 03:18.120
Look at this right here, okay?

67
03:18.120 --> 03:20.840
You may notice some information that you might not have paid attention

68
03:20.840 --> 03:22.120
to the first time you saw it.

69
03:22.120 --> 03:24.680
Let's say, for example, we want to create a message,

70
03:24.680 --> 03:26.080
what do we actually do?

71
03:26.080 --> 03:30.680
Well, we target this particular endpoint here using this URL.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

71
03:26.080 --> 03:30.680
Well, we target this particular endpoint here using this URL.

72
03:30.680 --> 03:34.840
But we have to specify a particular HTTP method with it, see this right here,

73
03:34.840 --> 03:38.760
to create a resource, we have to use a post request.

74
03:38.760 --> 03:41.080
Whereas if you want to edit a message,

75
03:41.080 --> 03:43.800
I.e. update an already existing message,

76
03:43.800 --> 03:45.880
what do we do? We target this particular URL.

77
03:45.880 --> 03:49.720
And this time we don't send a post request, we send a put request

78
03:49.720 --> 03:52.840
to effectively update that resource, make a change to it,

79
03:52.840 --> 03:54.760
one that already exists.

80
03:54.760 --> 03:57.400
Whereas say, for example, you want to retrieve information,

81
03:57.400 --> 04:00.040
such as get a list of all the messages, what can we do?
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

81
03:57.400 --> 04:00.040
such as get a list of all the messages, what can we do?

82
04:00.040 --> 04:02.360
We can target this particular URL.

83
04:02.360 --> 04:05.480
And then the HTTP method we use is a get request,

84
04:05.480 --> 04:09.480
whereas if you want to read all the information about direct messages,

85
04:09.480 --> 04:12.680
we use a different URL, which will target a different resource,

86
04:12.680 --> 04:15.280
a more specific one, in this case here, just direct messages.

87
04:15.280 --> 04:18.440
But again, we still use the same method.

88
04:18.440 --> 04:20.120
And that's because the same thing is happening,

89
04:20.120 --> 04:23.000
we're trying to read information from our servers, albeit,

90
04:23.000 --> 04:25.240
but just trying to read different things,

91
04:25.240 --> 04:28.440
different resources specified by different URLs.

92
04:28.440 --> 04:30.520
And of course, again, if you want to, like I said, delete.
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

92
04:28.440 --> 04:30.520
And of course, again, if you want to, like I said, delete.

93
04:30.520 --> 04:34.840
In this example here, a message, this here would be the URL we would use.

94
04:34.840 --> 04:38.760
And the HTTP method is going to be the delete method.

95
04:38.760 --> 04:41.320
And this here is basically how the rest architecture works.

96
04:41.320 --> 04:44.200
We use these methods and conjunction with these resources.

97
04:44.200 --> 04:47.480
And ultimately, we can dictate the type of communication

98
04:47.480 --> 04:49.220
that we want with our server.
