@@ -15,7 +15,7 @@ url = "https://api.apidash.dev"
15
15
16
16
response = HTTP.request("GET", url, status_exception=false)
17
17
18
- println("Status Code: $(response.status) $(HTTP.StatusCodes.statustext(response.status)) ")
18
+ println("Status Code: $(response.status)")
19
19
println("Response Body: \n$(String(response.body))")
20
20
""" ;
21
21
expect (
@@ -32,12 +32,12 @@ println("Response Body: \n$(String(response.body))")
32
32
url = "https://api.apidash.dev/country/data"
33
33
34
34
params = Dict(
35
- "code" => "US",
35
+ "code" =>[ "US"] ,
36
36
)
37
37
38
38
response = HTTP.request("GET", url, query=params, status_exception=false)
39
39
40
- println("Status Code: $(response.status) $(HTTP.StatusCodes.statustext(response.status)) ")
40
+ println("Status Code: $(response.status)")
41
41
println("Response Body: \n$(String(response.body))")
42
42
""" ;
43
43
expect (
@@ -54,12 +54,12 @@ println("Response Body: \n$(String(response.body))")
54
54
url = "https://api.apidash.dev/country/data"
55
55
56
56
params = Dict(
57
- "code" => "IND",
57
+ "code" =>[ "IND","US"] ,
58
58
)
59
59
60
60
response = HTTP.request("GET", url, query=params, status_exception=false)
61
61
62
- println("Status Code: $(response.status) $(HTTP.StatusCodes.statustext(response.status)) ")
62
+ println("Status Code: $(response.status)")
63
63
println("Response Body: \n$(String(response.body))")
64
64
""" ;
65
65
expect (
@@ -76,16 +76,16 @@ println("Response Body: \n$(String(response.body))")
76
76
url = "https://api.apidash.dev/humanize/social"
77
77
78
78
params = Dict(
79
- "num" => "8700000",
80
- "digits" => "3",
81
- "system" => "SS",
82
- "add_space" => "true",
83
- "trailing_zeros" => "true",
79
+ "num" =>[ "8700000"] ,
80
+ "digits" =>[ "3"] ,
81
+ "system" =>[ "SS"] ,
82
+ "add_space" =>[ "true"] ,
83
+ "trailing_zeros" =>[ "true"] ,
84
84
)
85
85
86
86
response = HTTP.request("GET", url, query=params, status_exception=false)
87
87
88
- println("Status Code: $(response.status) $(HTTP.StatusCodes.statustext(response.status)) ")
88
+ println("Status Code: $(response.status)")
89
89
println("Response Body: \n$(String(response.body))")
90
90
""" ;
91
91
expect (
@@ -108,7 +108,7 @@ headers = Dict(
108
108
109
109
response = HTTP.request("GET", url, headers=headers, status_exception=false)
110
110
111
- println("Status Code: $(response.status) $(HTTP.StatusCodes.statustext(response.status)) ")
111
+ println("Status Code: $(response.status)")
112
112
println("Response Body: \n$(String(response.body))")
113
113
""" ;
114
114
expect (
@@ -126,7 +126,7 @@ println("Response Body: \n$(String(response.body))")
126
126
url = "https://api.github.com/repos/foss42/apidash"
127
127
128
128
params = Dict(
129
- "raw" => "true",
129
+ "raw" =>[ "true"] ,
130
130
)
131
131
132
132
headers = Dict(
@@ -135,7 +135,7 @@ headers = Dict(
135
135
136
136
response = HTTP.request("GET", url, headers=headers, query=params, status_exception=false)
137
137
138
- println("Status Code: $(response.status) $(HTTP.StatusCodes.statustext(response.status)) ")
138
+ println("Status Code: $(response.status)")
139
139
println("Response Body: \n$(String(response.body))")
140
140
""" ;
141
141
expect (
@@ -154,7 +154,7 @@ url = "https://api.apidash.dev"
154
154
155
155
response = HTTP.request("GET", url, status_exception=false)
156
156
157
- println("Status Code: $(response.status) $(HTTP.StatusCodes.statustext(response.status)) ")
157
+ println("Status Code: $(response.status)")
158
158
println("Response Body: \n$(String(response.body))")
159
159
""" ;
160
160
expect (
@@ -172,7 +172,7 @@ println("Response Body: \n$(String(response.body))")
172
172
url = "https://api.github.com/repos/foss42/apidash"
173
173
174
174
params = Dict(
175
- "raw" => "true",
175
+ "raw" =>[ "true"] ,
176
176
)
177
177
178
178
headers = Dict(
@@ -181,7 +181,7 @@ headers = Dict(
181
181
182
182
response = HTTP.request("GET", url, headers=headers, query=params, status_exception=false)
183
183
184
- println("Status Code: $(response.status) $(HTTP.StatusCodes.statustext(response.status)) ")
184
+ println("Status Code: $(response.status)")
185
185
println("Response Body: \n$(String(response.body))")
186
186
""" ;
187
187
expect (
@@ -199,13 +199,13 @@ println("Response Body: \n$(String(response.body))")
199
199
url = "https://api.apidash.dev/humanize/social"
200
200
201
201
params = Dict(
202
- "num" => "8700000",
203
- "add_space" => "true",
202
+ "num" =>[ "8700000"] ,
203
+ "add_space" =>[ "true"] ,
204
204
)
205
205
206
206
response = HTTP.request("GET", url, query=params, status_exception=false)
207
207
208
- println("Status Code: $(response.status) $(HTTP.StatusCodes.statustext(response.status)) ")
208
+ println("Status Code: $(response.status)")
209
209
println("Response Body: \n$(String(response.body))")
210
210
""" ;
211
211
expect (
@@ -228,7 +228,7 @@ headers = Dict(
228
228
229
229
response = HTTP.request("GET", url, headers=headers, status_exception=false)
230
230
231
- println("Status Code: $(response.status) $(HTTP.StatusCodes.statustext(response.status)) ")
231
+ println("Status Code: $(response.status)")
232
232
println("Response Body: \n$(String(response.body))")
233
233
""" ;
234
234
expect (
@@ -246,8 +246,8 @@ println("Response Body: \n$(String(response.body))")
246
246
url = "https://api.apidash.dev/humanize/social"
247
247
248
248
params = Dict(
249
- "num" => "8700000",
250
- "digits" => "3",
249
+ "num" =>[ "8700000"] ,
250
+ "digits" =>[ "3"] ,
251
251
)
252
252
253
253
headers = Dict(
@@ -256,7 +256,7 @@ headers = Dict(
256
256
257
257
response = HTTP.request("GET", url, headers=headers, query=params, status_exception=false)
258
258
259
- println("Status Code: $(response.status) $(HTTP.StatusCodes.statustext(response.status)) ")
259
+ println("Status Code: $(response.status)")
260
260
println("Response Body: \n$(String(response.body))")
261
261
""" ;
262
262
expect (
@@ -275,7 +275,7 @@ url = "https://api.apidash.dev/humanize/social"
275
275
276
276
response = HTTP.request("GET", url, status_exception=false)
277
277
278
- println("Status Code: $(response.status) $(HTTP.StatusCodes.statustext(response.status)) ")
278
+ println("Status Code: $(response.status)")
279
279
println("Response Body: \n$(String(response.body))")
280
280
""" ;
281
281
expect (
@@ -296,7 +296,7 @@ url = "https://api.apidash.dev"
296
296
297
297
response = HTTP.request("HEAD", url, status_exception=false)
298
298
299
- println("Status Code: $(response.status) $(HTTP.StatusCodes.statustext(response.status)) ")
299
+ println("Status Code: $(response.status)")
300
300
println("Response Body: \n$(String(response.body))")
301
301
""" ;
302
302
expect (
@@ -315,7 +315,7 @@ url = "http://api.apidash.dev"
315
315
316
316
response = HTTP.request("HEAD", url, status_exception=false)
317
317
318
- println("Status Code: $(response.status) $(HTTP.StatusCodes.statustext(response.status)) ")
318
+ println("Status Code: $(response.status)")
319
319
println("Response Body: \n$(String(response.body))")
320
320
""" ;
321
321
expect (
@@ -344,7 +344,7 @@ headers = Dict(
344
344
345
345
response = HTTP.request("POST", url, headers=headers, body=payload, status_exception=false)
346
346
347
- println("Status Code: $(response.status) $(HTTP.StatusCodes.statustext(response.status)) ")
347
+ println("Status Code: $(response.status)")
348
348
println("Response Body: \n$(String(response.body))")
349
349
''' ;
350
350
expect (
@@ -376,7 +376,7 @@ headers = Dict(
376
376
377
377
response = HTTP.request("POST", url, headers=headers, body=payload, status_exception=false)
378
378
379
- println("Status Code: $(response.status) $(HTTP.StatusCodes.statustext(response.status)) ")
379
+ println("Status Code: $(response.status)")
380
380
println("Response Body: \n$(String(response.body))")
381
381
''' ;
382
382
expect (
@@ -403,7 +403,7 @@ headers = Dict(
403
403
404
404
response = HTTP.request("POST", url, headers=headers, body=payload, status_exception=false)
405
405
406
- println("Status Code: $(response.status) $(HTTP.StatusCodes.statustext(response.status)) ")
406
+ println("Status Code: $(response.status)")
407
407
println("Response Body: \n$(String(response.body))")
408
408
''' ;
409
409
expect (
@@ -430,7 +430,7 @@ payload = HTTP.Form(data)
430
430
431
431
response = HTTP.request("POST", url, body=payload, status_exception=false)
432
432
433
- println("Status Code: $(response.status) $(HTTP.StatusCodes.statustext(response.status)) ")
433
+ println("Status Code: $(response.status)")
434
434
println("Response Body: \n$(String(response.body))")
435
435
""" ;
436
436
expect (
@@ -461,7 +461,7 @@ headers = Dict(
461
461
462
462
response = HTTP.request("POST", url, headers=headers, body=payload, status_exception=false)
463
463
464
- println("Status Code: $(response.status) $(HTTP.StatusCodes.statustext(response.status)) ")
464
+ println("Status Code: $(response.status)")
465
465
println("Response Body: \n$(String(response.body))")
466
466
""" ;
467
467
expect (
@@ -486,7 +486,7 @@ payload = HTTP.Form(data)
486
486
487
487
response = HTTP.request("POST", url, body=payload, status_exception=false)
488
488
489
- println("Status Code: $(response.status) $(HTTP.StatusCodes.statustext(response.status)) ")
489
+ println("Status Code: $(response.status)")
490
490
println("Response Body: \n$(String(response.body))")
491
491
""" ;
492
492
expect (
@@ -511,7 +511,7 @@ payload = HTTP.Form(data)
511
511
512
512
response = HTTP.request("POST", url, body=payload, status_exception=false)
513
513
514
- println("Status Code: $(response.status) $(HTTP.StatusCodes.statustext(response.status)) ")
514
+ println("Status Code: $(response.status)")
515
515
println("Response Body: \n$(String(response.body))")
516
516
""" ;
517
517
expect (
@@ -528,8 +528,8 @@ println("Response Body: \n$(String(response.body))")
528
528
url = "https://api.apidash.dev/io/form"
529
529
530
530
params = Dict(
531
- "size" => "2",
532
- "len" => "3",
531
+ "size" =>[ "2"] ,
532
+ "len" =>[ "3"] ,
533
533
)
534
534
535
535
data = Dict(
@@ -542,7 +542,7 @@ payload = HTTP.Form(data)
542
542
543
543
response = HTTP.request("POST", url, body=payload, query=params, status_exception=false)
544
544
545
- println("Status Code: $(response.status) $(HTTP.StatusCodes.statustext(response.status)) ")
545
+ println("Status Code: $(response.status)")
546
546
println("Response Body: \n$(String(response.body))")
547
547
""" ;
548
548
expect (
@@ -559,8 +559,8 @@ println("Response Body: \n$(String(response.body))")
559
559
url = "https://api.apidash.dev/io/img"
560
560
561
561
params = Dict(
562
- "size" => "2",
563
- "len" => "3",
562
+ "size" =>[ "2"] ,
563
+ "len" =>[ "3"] ,
564
564
)
565
565
566
566
data = Dict(
@@ -577,7 +577,7 @@ headers = Dict(
577
577
578
578
response = HTTP.request("POST", url, headers=headers, body=payload, query=params, status_exception=false)
579
579
580
- println("Status Code: $(response.status) $(HTTP.StatusCodes.statustext(response.status)) ")
580
+ println("Status Code: $(response.status)")
581
581
println("Response Body: \n$(String(response.body))")
582
582
""" ;
583
583
expect (
@@ -601,12 +601,13 @@ payload = """{
601
601
}"""
602
602
603
603
headers = Dict(
604
+ "x-api-key" => "reqres-free-v1",
604
605
"content-type" => "application/json",
605
606
)
606
607
607
608
response = HTTP.request("PUT", url, headers=headers, body=payload, status_exception=false)
608
609
609
- println("Status Code: $(response.status) $(HTTP.StatusCodes.statustext(response.status)) ")
610
+ println("Status Code: $(response.status)")
610
611
println("Response Body: \n$(String(response.body))")
611
612
''' ;
612
613
expect (
@@ -630,12 +631,13 @@ payload = """{
630
631
}"""
631
632
632
633
headers = Dict(
634
+ "x-api-key" => "reqres-free-v1",
633
635
"content-type" => "application/json",
634
636
)
635
637
636
638
response = HTTP.request("PATCH", url, headers=headers, body=payload, status_exception=false)
637
639
638
- println("Status Code: $(response.status) $(HTTP.StatusCodes.statustext(response.status)) ")
640
+ println("Status Code: $(response.status)")
639
641
println("Response Body: \n$(String(response.body))")
640
642
''' ;
641
643
expect (
@@ -653,9 +655,13 @@ println("Response Body: \n$(String(response.body))")
653
655
654
656
url = "https://reqres.in/api/users/2"
655
657
656
- response = HTTP.request("DELETE", url, status_exception=false)
658
+ headers = Dict(
659
+ "x-api-key" => "reqres-free-v1",
660
+ )
661
+
662
+ response = HTTP.request("DELETE", url, headers=headers, status_exception=false)
657
663
658
- println("Status Code: $(response.status) $(HTTP.StatusCodes.statustext(response.status)) ")
664
+ println("Status Code: $(response.status)")
659
665
println("Response Body: \n$(String(response.body))")
660
666
""" ;
661
667
expect (
@@ -677,12 +683,13 @@ payload = """{
677
683
}"""
678
684
679
685
headers = Dict(
686
+ "x-api-key" => "reqres-free-v1",
680
687
"content-type" => "application/json",
681
688
)
682
689
683
690
response = HTTP.request("DELETE", url, headers=headers, body=payload, status_exception=false)
684
691
685
- println("Status Code: $(response.status) $(HTTP.StatusCodes.statustext(response.status)) ")
692
+ println("Status Code: $(response.status)")
686
693
println("Response Body: \n$(String(response.body))")
687
694
''' ;
688
695
expect (
0 commit comments