File: README.md

package info (click to toggle)
ulfius 2.7.15-2.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,856 kB
  • sloc: ansic: 23,025; makefile: 708; sh: 140
file content (31 lines) | stat: -rw-r--r-- 1,357 bytes parent folder | download | duplicates (3)
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
# multiple_callbacks_example

Run a webservice with multiple endpoint callbacks possible and different levels of priority

## Compile and run

```bash
$ make test
```

## Endpoints available:

### Multiple callbacks in cascade

- `GET http://localhost:6875/multiple/zero`: Send "Level zero" response (status 200)
- `GET http://localhost:6875/multiple/zero/one`: Send "Level zero\nlevel one" response (status 200)
- `GET http://localhost:6875/multiple/zero/one/two`: Send "Level zero\nlevel one\nlevel two" response (status 200)
- `GET http://localhost:6875/multiple/zero/one/two/three`: Send "Level zero\nlevel one\nlevel two\nlevel three" response (status 200)

### Multiple callbacks but the cascade is stopped at `/zero/onec/`

- `GET http://localhost:6875/multiple/zero/one`: Send "Level zero\nlevel one" response (status 200)
- `GET http://localhost:6875/multiple/zero/one/two`: Send "Level zero\nlevel one" response (status 200)

### Hello World with authentication

username: `test`
password: `testpassword`

- `GET http://localhost:6875/multiple/auth/data`: Send "Hello World!" response if authentication is correct (status 200), otherwise status 401 with realm "default_realm"
- `PUT http://localhost:6875/multiple/auth/data`: Send "Hello World!" response if authentication is correct (status 200), otherwise status 401 with realm "specific_realm"