1
0
Fork 0

Added clarifications

master
Hannes Ebner 3 years ago
parent 5caccfec0a
commit 01af58adf0

@ -20,11 +20,11 @@ Implementing a new resource involves creating a new class (see `StatusResource.j
## Exercise ## Exercise
1. Implement a new resource `/echo` that responds with the request body when posting (HTTP POST) to it; it should simply mirror the request back as response. 1. Implement a new resource `/echo` that responds with the request body when posting (HTTP POST) to it; it should simply mirror the request back as response.
2. Add content negotiation to the echo resource and convert the payload: if the request is made with MIME type `text/csv` (i.e., `Content-Type: text/csv`), and the response is expected to be delivered in `text/html` (i.e., `Accept: text/html`), then convert from CSV to a simple HTML table. Very basic handling of the CSV payload (use the snippet from the next section) is sufficient, you don't need to use third party libraries to handle advanced CSVs with apostrophes, line breaks, etc.. 2. Add content negotiation to the echo resource and convert the payload: if the request is made with MIME type `text/csv` (i.e., `Content-Type: text/csv`), and the response is expected to be delivered in `text/html` (i.e., `Accept: text/html`), then convert from CSV to a simple HTML table. Very basic handling of the CSV payload (use the snippet from the next section) is sufficient, you don't need to use third party libraries to handle advanced CSVs with apostrophes, line breaks, etc.. Only requests with `Content-Type: text/csv` and `Accept: text/html` need to trigger a conversion, all other requests should behave as described in 1. above.
Bonus for the Linked Data experienced: Bonus for the Linked Data experienced:
3. Add support for the output format `text/turtle` (the [RDF Turtle serialization format](https://www.w3.org/TR/turtle/)) to the echo resource. Use appropriate properties from the [Dublin Core Terms metadata specification](https://www.dublincore.org/specifications/dublin-core/dcmi-terms/). 3. Add support for the output format Turtle (the [RDF Turtle serialization format](https://www.w3.org/TR/turtle/)) to the echo resource (triggered by `Accept: text/turtle`). Use appropriate properties from the [Dublin Core Terms metadata specification](https://www.dublincore.org/specifications/dublin-core/dcmi-terms/) to map the CSV data to Turtle.
### CSV snippet ### CSV snippet
@ -35,6 +35,10 @@ Less important document,,2022-03-31
Last document,, Last document,,
``` ```
## Questions
If anything is unclear or if you get stuck somewhere in the exercise, do not hesitate to contact [Hannes](mailto:hannes@metasolutions.se) for advice.
## Result ## Result
Document your implementation in Text or Markdown format and send it along with your code as a tar.gz archive to [hannes@metasolutions.se](mailto:hannes@metasolutions.se). You can also send a link to a Git repository. Document your implementation in Text or Markdown format and send it along with your code as a tar.gz archive to [Hannes](mailto:hannes@metasolutions.se). You can also send a link to a Git repository.

Loading…
Cancel
Save