@@ -15,56 +15,62 @@ extension HTTP
15
15
}
16
16
extension HTTP . ServerResponse
17
17
{
18
- @inlinable public static
19
- func ok( _ resource: HTTP . Resource ) -> Self
18
+ @inlinable public
19
+ static func ok( _ resource: HTTP . Resource ) -> Self
20
20
{
21
21
. resource( resource, status: 200 )
22
22
}
23
23
24
- @inlinable public static
25
- var noContent : Self
24
+ @inlinable public
25
+ static func created( _ resource: HTTP . Resource ) -> Self
26
+ {
27
+ . resource( resource, status: 201 )
28
+ }
29
+
30
+ @inlinable public
31
+ static var noContent : Self
26
32
{
27
33
. resource( " " , status: 204 )
28
34
}
29
35
30
- @inlinable public static
31
- func multiple( _ resource: HTTP . Resource ) -> Self
36
+ @inlinable public
37
+ static func multiple( _ resource: HTTP . Resource ) -> Self
32
38
{
33
39
. resource( resource, status: 300 )
34
40
}
35
41
36
- @inlinable public static
37
- func unauthorized( _ resource: HTTP . Resource ) -> Self
42
+ @inlinable public
43
+ static func unauthorized( _ resource: HTTP . Resource ) -> Self
38
44
{
39
45
. resource( resource, status: 401 )
40
46
}
41
47
42
- @inlinable public static
43
- func forbidden( _ resource: HTTP . Resource ) -> Self
48
+ @inlinable public
49
+ static func forbidden( _ resource: HTTP . Resource ) -> Self
44
50
{
45
51
. resource( resource, status: 403 )
46
52
}
47
53
48
- @inlinable public static
49
- func notFound( _ resource: HTTP . Resource ) -> Self
54
+ @inlinable public
55
+ static func notFound( _ resource: HTTP . Resource ) -> Self
50
56
{
51
57
. resource( resource, status: 404 )
52
58
}
53
59
54
- @inlinable public static
55
- func gone( _ resource: HTTP . Resource ) -> Self
60
+ @inlinable public
61
+ static func gone( _ resource: HTTP . Resource ) -> Self
56
62
{
57
63
. resource( resource, status: 410 )
58
64
}
59
65
60
- @inlinable public static
61
- func unsupportedMediaType( _ resource: HTTP . Resource ) -> Self
66
+ @inlinable public
67
+ static func unsupportedMediaType( _ resource: HTTP . Resource ) -> Self
62
68
{
63
69
. resource( resource, status: 415 )
64
70
}
65
71
66
- @inlinable public static
67
- func error( _ resource: HTTP . Resource ) -> Self
72
+ @inlinable public
73
+ static func error( _ resource: HTTP . Resource ) -> Self
68
74
{
69
75
. resource( resource, status: 500 )
70
76
}
0 commit comments