Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Proper syntax for optional header parameter for text/csv mimetype?

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?

like image 206
i_am_jorf Avatar asked Mar 17 '13 05:03

i_am_jorf


People also ask

What is MIME type for CSV?

Expected MIME type is "text/csv", "application/vnd.

What is header in CSV?

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.

What is the difference between text CSV and application CSV?

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.

Is CSV text plain?

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.


1 Answers

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.

like image 126
hobbs Avatar answered Oct 17 '22 21:10

hobbs