how do we set the content type header for a local file?
how do we set the content type header for a page not served from a server? (i.e. a simple local file saved to desktop)
Say i have a .xml file that i would like to open as application/xml
in google-chrome. how do i specify it?
Now i want to open that same file under text/xml
with google-chrome is that an option?
My file:
<?xml version=开发者_运维技巧"1.0"?>
<test></test>
Headers are only sent to and served by servers. Without a server, there is no such thing as a request, or a response, and therefore there will be no content-type header to receive.
If you are trying to keep this local, you can open it on a localhost server setup. IIS and Apache (and many others) will run on your local development box, no problem.
No, you can't. HTTP header exists only if it's a HTTP request or response. AFAIK, you can't set more than 1 association to a single file type in your web browser.
精彩评论