VirtualPathProvider and mimetype (for RESTful applications)

F

forge1968

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top