﻿1
00:00:00,210 --> 00:00:04,799
you

2
00:00:04,799 --> 00:00:07,870
welcome to section eight working with

3
00:00:07,870 --> 00:00:11,798
akka HTTP in the previous section we

4
00:00:11,798 --> 00:00:13,929
were working with a curse streams we

5
00:00:13,929 --> 00:00:15,429
have looked into the main parts annika

6
00:00:15,429 --> 00:00:19,719
streams sources flows and sinks and we

7
00:00:19,719 --> 00:00:21,579
were working with graphs and stream I oh

8
00:00:21,579 --> 00:00:25,480
and finally we tested them in this

9
00:00:25,480 --> 00:00:27,399
section we will introduce another module

10
00:00:27,399 --> 00:00:31,089
of akka akka HTTP we'll do a quick

11
00:00:31,089 --> 00:00:33,939
introduction to the aqha HTTP module and

12
00:00:33,939 --> 00:00:35,409
work with the client-side and

13
00:00:35,409 --> 00:00:38,408
server-side api's we will then implement

14
00:00:38,408 --> 00:00:40,988
a restful api server and introduce

15
00:00:40,988 --> 00:00:44,499
testing let's start with the first intro

16
00:00:44,499 --> 00:00:48,280
video first we'll look at how the HTTP

17
00:00:48,280 --> 00:00:50,679
module fits into the aqha ecosystem and

18
00:00:50,679 --> 00:00:52,689
then we'll see which modules it itself

19
00:00:52,689 --> 00:00:56,558
is composed of let's start acha is a

20
00:00:56,558 --> 00:00:58,509
toolkit for building highly concurrent

21
00:00:58,509 --> 00:01:01,058
and distributed applications when you

22
00:01:01,058 --> 00:01:03,128
think about distribution you think about

23
00:01:03,128 --> 00:01:04,659
how to integrate the stuff that we've

24
00:01:04,659 --> 00:01:06,609
just distributed if you want to

25
00:01:06,609 --> 00:01:07,959
distribute your application across

26
00:01:07,959 --> 00:01:11,319
threads acha gives you actors and when

27
00:01:11,319 --> 00:01:12,909
you want to distribute your application

28
00:01:12,909 --> 00:01:15,670
across machines acha gives you a cluster

29
00:01:15,670 --> 00:01:17,950
and akka remoting when your application

30
00:01:17,950 --> 00:01:20,409
wants to interact with external services

31
00:01:20,409 --> 00:01:24,670
akka gives you a key HTTP since HTTP is

32
00:01:24,670 --> 00:01:26,680
the de facto standard of many web-based

33
00:01:26,680 --> 00:01:29,319
applications and the whole world talks

34
00:01:29,319 --> 00:01:32,289
using this protocol it makes sense when

35
00:01:32,289 --> 00:01:33,608
you want to talk to the external world

36
00:01:33,608 --> 00:01:38,500
you use HTTP module acha HTTP isn't a

37
00:01:38,500 --> 00:01:40,539
web framework it's a toolkit for

38
00:01:40,539 --> 00:01:43,000
providing and consuming HTTP based

39
00:01:43,000 --> 00:01:45,640
services this means the main goal of

40
00:01:45,640 --> 00:01:47,890
akka HTTP is to integrate your

41
00:01:47,890 --> 00:01:50,489
application with the external world and

42
00:01:50,489 --> 00:01:53,049
if you think about implementing the web

43
00:01:53,049 --> 00:01:55,450
application that has a lot of views it

44
00:01:55,450 --> 00:01:57,459
needs to prepare assets such as images

45
00:01:57,459 --> 00:02:00,670
that can press JavaScript and CSS and so

46
00:02:00,670 --> 00:02:03,549
on thus it is better to choose the web

47
00:02:03,549 --> 00:02:06,399
framework play rather than occur HTTP

48
00:02:06,399 --> 00:02:09,849
the akka HTTP module is implemented on

49
00:02:09,849 --> 00:02:12,250
top of extremes which are implemented on

50
00:02:12,250 --> 00:02:14,979
top of a key actors each layer provides

51
00:02:14,979 --> 00:02:17,590
additional capabilities and all limit

52
00:02:17,590 --> 00:02:20,169
to what you can do with them it has a

53
00:02:20,169 --> 00:02:23,709
full server and client side HTTP 1.1

54
00:02:23,709 --> 00:02:27,039
stack in other words if you want to talk

55
00:02:27,039 --> 00:02:28,989
with the external service you will need

56
00:02:28,989 --> 00:02:31,840
to use a client-side API and if you want

57
00:02:31,840 --> 00:02:33,610
to provide a service to the world you

58
00:02:33,610 --> 00:02:36,969
will need to use a server-side API acha

59
00:02:36,969 --> 00:02:39,580
HTTP is structured into several modules

60
00:02:39,580 --> 00:02:43,030
acha HTTP core which contains a complete

61
00:02:43,030 --> 00:02:45,759
low level for server and client side

62
00:02:45,759 --> 00:02:48,068
implementation of HTTP such as a

63
00:02:48,068 --> 00:02:52,090
connection and TLS management acha HTTP

64
00:02:52,090 --> 00:02:53,680
which contains higher level

65
00:02:53,680 --> 00:02:55,539
functionality such as marshalling

66
00:02:55,539 --> 00:02:58,120
compression decompression as well as a

67
00:02:58,120 --> 00:03:00,280
powerful routing dsl for defining

68
00:03:00,280 --> 00:03:03,818
http-based ap is on the server side acha

69
00:03:03,818 --> 00:03:07,060
HTTP test kit which contains a set of

70
00:03:07,060 --> 00:03:09,189
utilities for verifying server side

71
00:03:09,189 --> 00:03:12,878
service implementations next we have a

72
00:03:12,878 --> 00:03:16,959
cat HTTP spray Jason which contains a

73
00:03:16,959 --> 00:03:19,709
predefined glue code for serializing and

74
00:03:19,709 --> 00:03:22,659
deserializing custom types from and to

75
00:03:22,659 --> 00:03:26,049
Jason with spray Jason it is possible to

76
00:03:26,049 --> 00:03:28,750
use acha HTTP with other Jason

77
00:03:28,750 --> 00:03:31,269
serializes and there exist community

78
00:03:31,269 --> 00:03:33,519
projects providing these integrations if

79
00:03:33,519 --> 00:03:35,079
you prefer to use something other than

80
00:03:35,079 --> 00:03:37,719
sprays JSON library which is very fast

81
00:03:37,719 --> 00:03:40,199
that requires a bit of coding to set up

82
00:03:40,199 --> 00:03:44,169
lastly we have a cat HTTP XML which

83
00:03:44,169 --> 00:03:46,870
contains a predefined glue code for

84
00:03:46,870 --> 00:03:49,299
serializing and deserialising custom

85
00:03:49,299 --> 00:03:53,379
types from and to XML with Scarlett XML

86
00:03:53,379 --> 00:03:56,079
at the end of the first video on acha

87
00:03:56,079 --> 00:03:59,769
HTTP we just introduced acha HTTP module

88
00:03:59,769 --> 00:04:01,264
and its structure


