According to RFC 4180:
...the presence or absence of the header line should be indicated via the optional "header" parameter of this MIME type...
So, does that mean the correct string is:
text/csv; header
Or perhaps:
text/csv; header=true
Or something else?
Expected MIME type is "text/csv", "application/vnd.
A header of the CSV file is an array of values assigned to each of the columns. It acts as a row header for the data. Initially, the CSV file is converted to a data frame and then a header is added to the data frame. The contents of the data frame are again stored back into the CSV file.
If a server says "This data is of type text/csv" the client can understand that can render that data internally, while if the server says "This data is of type application/csv" the client knows that it needs to launch the application that is registered on the OS to open csv files.
A CSV file typically stores tabular data (numbers and text) in plain text, in which case each line will have the same number of fields. The CSV file format is not fully standardized.
The "header" parameter indicates the presence or absence of the header line. Valid values are "present" or "absent".
So if you use that parameter, the full MIME type would be text/csv; header=present
or text/csv; header=absent
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With