blob: 522d12915640588449ed775bc70add201059b9d6 (
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
|
# Lazybones Demo App - v0.0.0
Just an API that defines some endpoints. These
endpoints aren't meant to accomplish anything. Merely testing out
the lazybones HTTP routing framework.
## Endpoints
### GET /animal/:genus:/:species:
*text/plain*
Route Variables:
- GENUS
- SPECIES
Prints information about [Animal](#animal) specified by GENUS and SPECIES
### POST /crapshoot
*text/plain*
Authorization Required:
> Randomly decides that the request is authorized
Echos back 'You made it' if the request was authorized
### POST /hello/:who:
*text/plain*
Authorization Required:
> Request is authorized if it contains the right TESTAPPSESSION
> cookie. Obtain such a cookie by posting to the /login endpoint.
Route Variables:
- WHO
Echo's back 'Hello WHO, I got your message BODY' where BODY is the post body.
### GET /hello/:who:
*text/plain*
Route Variables:
- WHO
Echos back Hello WHO
### POST /login
*text/plain*
Dummy login endpoint for returning a session cookie. Always returns
the "true" and sends a set-cookie header, setting 'testappsession'
to 'coolsessionbro'.
### GET /person/:person:
*application/json*
Route Variables:
- PERSON: ID of a person
Returns a json representation of the [Person](#person).
### GET /random/:lo:/:hi:
*text/plain*
Route Variables:
- LO: An Integer
- HI: An Integer
Echo back a random number between lo and hi
### GET /search
*text/plain*
Documented Query Parameters:
- name: A String
- age: An Integer
Echo the search parameters in a nice list.
## Definitions
<h3 id='#person'>Person</h3>
An instance of person. As JSON, it looks like:
{
"NAME" : string ,
"OCCUPATION" : string ,
"ID" : integer
}
<h3 id='#animal'>animal</h3>
An animal
**Slots:**
- GENUS: The genus
- SPECIES: The species
- POPULATION: Population on Earth
- HABITAT: Where the animal lives
|