Trying to use text/csv as the format on one of my handlers but I am getting the error below.
warning: 'text/csv' is not a known content-type
--> src/main.rs:56:28
|
56 | #[post("/upload", format = "text/csv", data = "<file>")]
| ^^^^^^^^^^
error: `format` must be a "content/type"`
--> src/main.rs:56:19
|
56 | #[post("/upload", format = "text/csv", data = "<file>")]
| ^^^^^^^^^^^^^^^^^^^
|
= help: format, if specified, must be a key-value pair where
the key is `format` and the value is a string representing the
content-type accepted. e.g: format = "application/json
Edit: Maybe in the documentation show the accepted format types.
Edit2: Workaround is to just use text/plain and just assume it is a csv.
Confirmed. Rocket should warn on, but not deny, unknown content types. Further, RFC7111 declares the Content-Type for CSV files to be text/csv, so Rocket should know about it. Fixing now.