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
|
# simple_example
Run a simple webservice that listen on port 8537.
## Compile and run
```bash
$ make test
```
## Compile with Ulfius built as a static archive
Ulfius must be built as a static archive and installed in the $(PREFIX) directory.
```bash
$ make static
```
### https connection
If you want this program to listen to a secure (https) connection, create a certificate with its certificate and private keys in to separate files, and run the program with the options `-secure <key_file> <cert_file>`.
## Endpoints available:
- `GET http://localhost:8537/test`: A "Hello World!" response (status 200)
- `GET http://localhost:8537/test/empty`: An empty response (status 200)
- `POST http://localhost:8537/test`: Will display all requests parameters (body, headers, cookies, etc.) given by the client
- `GET http://localhost:8537/test/param/:foo`: Will display all requests parameters (body, headers, cookies, etc.) given by the client
- `POST http://localhost:8537/test/param/:foo`: Will display all requests parameters (body, headers, cookies, etc.) given by the client
- `PUT http://localhost:8537/test/param/:foo`: Will display all requests parameters (body, headers, cookies, etc.) given by the client
- `DELETE http://localhost:8537/test/param/:foo`: Will display all requests parameters (body, headers, cookies, etc.) given by the client
- `GET http://localhost:8537/test/multiple/:multiple/:multiple/:not_multiple`: Will display all requests parameters (body, headers, cookies, etc.) given by the client, and multiple values in `map_url:multiple` key
- `GET http://localhost:8537/testcookie/:lang/:extra` Will send a cookie to the client with `lang` and `extra` values in it
|