4 ms·
I know where you are coming from, I tripped over the REST aspects of the MVC framework recently. Found it rather difficult to have the same end points, couldn't
by rjd 15y ago
I know where you are coming from, I tripped over the REST aspects of the MVC framework recently. Found it rather difficult to have the same end points, couldn't have JSON, XML, form data going to the same URL. I almost walked away from the framework annoys I had to have a messy API.
I ended up creating my own controller class inherited from the normal controller class. Basically I had to set the 'Index' method to scoop everything and then manually detect the HTTP VERB and MIME type of the incoming request and then pass the request along accordingly. Quite nice solution, even built all the error handing and logging into the new class. Makes creating a new end point a dream.
Although I haven't tried yet I pretty sure doing this method will be handle webdav requests as well.