Wednesday, October 08, 2003

Interesting discussion on content negotiation 

Should you use Content Negotiation in your Web Services? I currently use query parameters i.e. &format=xml or &format=excel I also try and set a consistent mime type and file extension if I’m downloading a file i.e. ContentType = “text/xml” AppendHeader(“Content-Disposition“,“inline;filename=MyFile.xml“) if it is being dynamically generated the actual URL is MyFilename.aspx (.jsp) However, Windows applications seem to use the file extension, if they directly open a file, so the mime-type gets ignored. For example, if I create a report as rich text format with a “.rtf” file extension, but give it a mime-type of “application/vnd.ms-excel” instead of “application/rtf“, the open/save dialog will tell me the content type is excel but then open it in MS Word. Guy

Links to this post:


Comments: Post a Comment

This page is powered by Blogger. Isn't yours?