-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathrequest.txt
More file actions
82 lines (81 loc) · 1.62 KB
/
Copy pathrequest.txt
File metadata and controls
82 lines (81 loc) · 1.62 KB
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
79
80
81
82
mito -use http,collections,crypto src.cel
! stderr .
cmp stdout want.txt
-- src.cel --
[
request("GET", "http://www.example.com/"),
request("GET", "http://www.example.com/", "request data"),
request("GET", "http://www.example.com/").with({"Header":{
"Authorization": ["Basic "+string(base64("username:password"))],
}}),
get_request("http://www.example.com/"),
post_request("http://www.example.com/", "text/plain", "request data"),
]
-- want.txt --
[
{
"Close": false,
"ContentLength": 0,
"Header": {},
"Host": "www.example.com",
"Method": "GET",
"Proto": "HTTP/1.1",
"ProtoMajor": 1,
"ProtoMinor": 1,
"URL": "http://www.example.com/"
},
{
"Body": "request data",
"Close": false,
"ContentLength": 12,
"Header": {},
"Host": "www.example.com",
"Method": "GET",
"Proto": "HTTP/1.1",
"ProtoMajor": 1,
"ProtoMinor": 1,
"URL": "http://www.example.com/"
},
{
"Close": false,
"ContentLength": 0,
"Header": {
"Authorization": [
"Basic dXNlcm5hbWU6cGFzc3dvcmQ="
]
},
"Host": "www.example.com",
"Method": "GET",
"Proto": "HTTP/1.1",
"ProtoMajor": 1,
"ProtoMinor": 1,
"URL": "http://www.example.com/"
},
{
"Close": false,
"ContentLength": 0,
"Header": {},
"Host": "www.example.com",
"Method": "GET",
"Proto": "HTTP/1.1",
"ProtoMajor": 1,
"ProtoMinor": 1,
"URL": "http://www.example.com/"
},
{
"Body": "request data",
"Close": false,
"ContentLength": 12,
"Header": {
"Content-Type": [
"text/plain"
]
},
"Host": "www.example.com",
"Method": "POST",
"Proto": "HTTP/1.1",
"ProtoMajor": 1,
"ProtoMinor": 1,
"URL": "http://www.example.com/"
}
]