VirtualPathProvider and mimetype (for RESTful applications)

Discussion in 'ASP .Net' started by forge1968, Apr 26, 2007.

  1. forge1968

    forge1968 Guest

    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.
     
    forge1968, Apr 26, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?S2Vubnk=?=

    Problem with VirtualPathProvider

    =?Utf-8?B?S2Vubnk=?=, Apr 30, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    920
    =?Utf-8?B?S2Vubnk=?=
    Apr 30, 2006
  2. VV

    virtualpathprovider

    VV, Feb 20, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    430
  3. Charles Zhang

    Dynamic web pages using VirtualPathProvider

    Charles Zhang, Jun 15, 2007, in forum: ASP .Net
    Replies:
    5
    Views:
    526
    Walter Wang [MSFT]
    Jun 21, 2007
  4. Jan
    Replies:
    2
    Views:
    429
  5. Sriram Srivatsan

    VirtualPathProvider and Application Restart

    Sriram Srivatsan, Aug 11, 2008, in forum: ASP .Net
    Replies:
    1
    Views:
    619
    Sriram Srivatsan
    Aug 11, 2008
Loading...

Share This Page