Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between using application/csv vs text/csv? [duplicate]

What's the difference between using application/csv vs text/csv as the HTTP Accept Header?

like image 793
Glide Avatar asked Sep 21 '13 01:09

Glide


2 Answers

A MIME type is used so software ( like a browser for example ) can know how to handle the data.

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.

text/csv is more generic.

like image 110
G-Man Avatar answered Nov 06 '22 20:11

G-Man


text/csv is more appropriate because application as a first part implies some interactivity. Your text file not being interactive, it should be announced as text.

like image 20
zneak Avatar answered Nov 06 '22 18:11

zneak