aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/world/net/http.lux
blob: d3bbf5a3769cc7b56519e8a0a98d64abaea624c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
(.module:
  [lux #*
   [control
    [concurrency
     [promise (#+ Promise)]
     [frp (#+ Channel)]]]
   [data
    [error (#+ Error)]
    [format
     [context (#+ Context)]]]
   [world
    [binary (#+ Binary)]]]
  [// (#+ URL)])

(type: #export Version Text)

(type: #export Method
  #Post
  #Get
  #Put
  #Patch
  #Delete
  #Head
  #Connect
  #Options
  #Trace)

(type: #export Port Nat)

(type: #export Status Nat)

(type: #export Header
  (-> Context Context))

(type: #export Data
  Binary)

(type: #export Body
  (Channel Data))

(type: #export URI
  Text)

(type: #export Scheme
  #HTTP
  #HTTPS)

(type: #export Address
  {#port Port
   #host Text})

(type: #export Identification
  {#local  Address
   #remote Address})

(type: #export Protocol
  {#version Version
   #scheme  Scheme})

(type: #export Resource
  {#method Method
   #uri    URI})

(type: #export Message
  {#headers Context
   #body    Body})

(type: #export Request
  [Identification Protocol Resource Message])

(type: #export Response
  [Status Message])

(type: #export Server
  (-> Request (Promise Response)))

(type: #export Client
  (-> [Method URL Context Data] (Promise (Error Response))))