1
00:00:00,690 --> 00:00:03,720
Hello and welcome to this lecture.

2
00:00:04,080 --> 00:00:14,820
In this lecture we'll be looking at how Ajax makes a request call to the server to make a request or

3
00:00:14,820 --> 00:00:17,210
send the request to the server.

4
00:00:17,250 --> 00:00:25,590
We have to use two methods that are part of the exe email hasty TTP request project.

5
00:00:25,690 --> 00:00:30,590
The methods are open and sent.

6
00:00:30,600 --> 00:00:36,890
So this will be how you send a request so it be it will be x.

7
00:00:36,960 --> 00:00:41,100
T T P don't open and so what this does.

8
00:00:41,130 --> 00:00:47,780
In between the parenthesis here you have to specify setting parameters here.

9
00:00:47,780 --> 00:00:50,370
Prepartum if there's a first one.

10
00:00:50,380 --> 00:00:51,480
Here's a get.

11
00:00:51,510 --> 00:01:01,380
This is how you will send the information to the server Okay and then the second parameter here is see

12
00:01:01,380 --> 00:01:09,020
how chawl text that you want to send and then this parameter.

13
00:01:09,020 --> 00:01:15,470
Here you set it to true if you want the Wally to be a scene.

14
00:01:15,480 --> 00:01:16,260
Chronos.

15
00:01:16,320 --> 00:01:20,440
If you don't want it to be synchronous then you set it to false.

16
00:01:20,530 --> 00:01:27,390
But most cases people say it is true because you wanted to be a sequence you don't want the web browser

17
00:01:27,390 --> 00:01:28,530
to be held up.

18
00:01:28,740 --> 00:01:30,210
Why the request is made.

19
00:01:30,210 --> 00:01:36,730
So you want it to be a synchronous or when the request is made and the response comes back.

20
00:01:36,760 --> 00:01:49,410
It updates what he needs to behind the scene so when you see him be open method you have to specify

21
00:01:50,380 --> 00:01:59,350
the method first so there are two main methods with the open you got to get or the post so get or post.

22
00:01:59,370 --> 00:02:02,240
Post is more secure.

23
00:02:02,580 --> 00:02:11,470
So there are two methods with the open get off post and then here is see you are real or B.

24
00:02:11,480 --> 00:02:12,600
This is a website.

25
00:02:12,600 --> 00:02:16,450
This is where you specify the website you can send anything.

26
00:02:16,520 --> 00:02:21,780
So in this case I'm sending a text so you would be text oil.

27
00:02:21,810 --> 00:02:26,000
Could be a Website uriel this is where you specify it.

28
00:02:26,230 --> 00:02:32,090
And in this program if Here is where you specify if you want it to be a synchronous.

29
00:02:32,190 --> 00:02:34,030
You said that too true.

30
00:02:34,190 --> 00:02:40,060
If you don't want it to be sintra Cosequin not she said this tool force had been on this line here.

31
00:02:40,070 --> 00:02:42,550
This is how you sent it just.

32
00:02:42,780 --> 00:02:48,260
TTP don't send so few use in they get method.

33
00:02:48,510 --> 00:02:53,570
You will usually use the send to go with that.

34
00:02:53,580 --> 00:02:58,400
However if you are send in a string.

35
00:02:59,090 --> 00:03:00,220
2 December.

36
00:03:00,380 --> 00:03:03,440
Dare you be using the post.

37
00:03:04,010 --> 00:03:07,310
So if they data you're sending it has Trink you.

38
00:03:07,310 --> 00:03:12,260
This is how you send it in between the Param if you type in a drink.

39
00:03:12,340 --> 00:03:18,090
Ben you used the post method rather than to get method right.

40
00:03:18,290 --> 00:03:27,440
If you're not using this treehaven are used in the post to get method is a lot simpler and faster than

41
00:03:27,440 --> 00:03:28,900
the post metate.

42
00:03:28,970 --> 00:03:32,350
So in most cases you can use the get method.

43
00:03:32,550 --> 00:03:42,230
However if you are sending a large amount of data is best to use the pulls method because it has no

44
00:03:42,230 --> 00:03:43,460
size limit.

45
00:03:43,700 --> 00:03:46,830
So things like send use that input.

46
00:03:47,130 --> 00:03:53,560
We can contain on known characters post is more robust and secure than get.

47
00:03:53,790 --> 00:04:02,870
So if you look in out security then always use Post because it's more secured and always set his value

48
00:04:02,900 --> 00:04:04,710
to to through.

49
00:04:04,820 --> 00:04:10,560
If you want be a jar to be synchronous this must be true.

50
00:04:10,770 --> 00:04:16,010
Has set it to force then it loses it's a synchronoss Nature.

51
00:04:16,490 --> 00:04:19,120
Thank you so much for your time.

52
00:04:19,340 --> 00:04:21,610
I hope the video has been useful.

53
00:04:21,680 --> 00:04:28,280
So this is how you would make a Ajax request call to a web server.

54
00:04:28,320 --> 00:04:32,290
He is in the dot open effort.

55
00:04:32,420 --> 00:04:33,740
It contains this.

56
00:04:33,830 --> 00:04:43,760
X x Haiti t.p contains two main method which is to get the post it gets simpler but not as secure as

57
00:04:43,790 --> 00:04:50,980
post and there are signs limitations with Leopard whereas the post there's no restrictions.

58
00:04:51,230 --> 00:04:53,900
It's a lot safer as well.

59
00:04:53,900 --> 00:05:00,420
So if you are sending strings make sure you use most strings is also known as text.

60
00:05:00,710 --> 00:05:04,770
And there you can enclose the string inside the practices.

61
00:05:04,880 --> 00:05:10,480
If you are not send in a string then you don't need to put the value inside the offices.

62
00:05:10,850 --> 00:05:13,430
Okay thank you so much and take care.

63
00:05:13,430 --> 00:05:14,260
Bye for now.
