469,889 Members | 1,255 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,889 developers. It's quick & easy.

VirtualPathProvider and mimetype (for RESTful applications)

I want to handle URLs like this on my IIS site:

http://localhost/myapp/REST/foo/1 ('REST/foo/1' doesn't exist - I'll
dynamically create the content).

I have implemented my own VirtualPathProvider and VirtualFile classes
to do this. However, the mimetype of the response is 'application/
octet-stream'. I want it to be 'text/xml'.

Changing HttpContext.Current.Response.ContentType does not affect the
response.

The only way I've found is to append a '.xml' to the URL:

http://localhost/myapp/REST/foo/1.xml

This is *really* ugly....

How can I change the response mimetype from within my custom
VirtualFile class?

I'm using .NET 2 and IIS 5 & 6.

Thanks in advance for any help!

M.D.

Apr 26 '07 #1
0 1118

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Kenny | last post: by
reply views Thread by Pavel Kocar | last post: by
1 post views Thread by mdufour | last post: by
1 post views Thread by VV | last post: by
reply views Thread by Shane | last post: by
5 posts views Thread by Charles Zhang | last post: by
6 posts views Thread by MarkyMarc | last post: by
reply views Thread by Ivan Ven Osdel | last post: by
1 post views Thread by Sriram Srivatsan | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.