-
Notifications
You must be signed in to change notification settings - Fork 0
/
implementation_tests.api
61 lines (51 loc) · 1.34 KB
/
implementation_tests.api
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
## This file contains example of apicurl endpoint definition, along with the resulting requests.
## It can be used to test an implementation.
# Basic request
> http http://example.com/get
expect
GET /get HTTP/1.1
Host: example.com
# Url with a variable
endpoint=get
> http http://example.com/$endpoint
expect
GET /get HTTP/1.1
# Querystring
> http http://example.com/get key==value
expect
GET /get?key=value HTTP/1.1
# Multiple querystrings
> http http://example.com/get key==value other_key==other_value
expect
GET /get?key=value&other_key=other_value HTTP/1.1
# Space in quoted string
> http http://example.com/get key=="value with space"
expect
GET /get?key=value+with+space HTTP/1.1
# Headers
> http http://example.com/get Authorization:pouet
expect
Authorization: pouet
# explicit POST
> http POST http://example.com/post
expect
POST /post HTTP/1.1
# Json body
> http http://example.com/post key=value
expect
POST /post HTTP/1.1
Content-Type: application/json
{"key":"value"}
# Form body
> http -f http://example.com/post key=value
expect
POST /post HTTP/1.1
Content-Type: application/x-www-form-urlencoded
key=value
# A mix of querystring, headers and body
> http http://example.com/post key==value key_body=value_body Authorization:pouet
expect
POST /post?key=value HTTP/1.1
Content-Type: application/json
Authorization: pouet
{"key_body":"value_body"}