3

I was verifying the HTTP content-type header and the file extensions via postman (Using 'Send and Download' button with the HTTP GET request on file URLs). We have different type of sample files available at http://www.sample-videos.com. and following are some results

  • content-type image/jpeg file downloaded as response.jpg
  • content-type audio/mpeg file downloaded as response.mpg
  • content-type application/vnd.ms-excel file downloaded as response.xls
  • content-type application/vnd.ms-powerpoint file downloaded as sample.ppt
  • content-type text/plain file downloaded as response.txt
  • content-type application/pdf file downloaded as sample.pdf
  • content-type text/csv file downloaded as response.txt

Can anyone please explain why the text/csv file is downloaded with extension .txt instead of .csv? Also see the screenshot below.

Screenshot from postman with the response headers and save dialog

Master Po
  • 1,497
  • 1
  • 23
  • 42

1 Answers1

0

That's the default postman goes to when it doesn't fully understand the content-type. You need to include 'charset=utf-8' in the content type, as in text/csv; charset=utf-8

Ray
  • 3,864
  • 7
  • 24
  • 36