Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple values on HTTP headers

Is this correct?

var headers = new Headers();
headers.append('Accept', 'application/json, application/pdf')

I want to accept both json and pdf files.

like image 688
Mika Avatar asked Sep 19 '15 10:09

Mika


1 Answers

Yes, it is correct. Example form w3c:

Accept: text/plain, text/html
like image 101
Andriy Kuba Avatar answered Oct 03 '22 18:10

Andriy Kuba