httpverbs

ASP.NET MVC AcceptVerbs and registering routes

Hi Folks, do I have to register the HttpVerb constraint in my route definition (when i'm registering routes) if i have decorated my action method with the [AcceptVerbs(..)] attribute already? eg. i have this. [AcceptVerbs(HttpVerbs.Post)] public ActionResult Create(FormCollection formCollection) { .. } do i need to add this to the r...

Http verb decorator for Django?

In ASP.NET MVC, you can use the AcceptVerbs attribute to correlate a view function with a verb: public ActionResult Create() { // do get stuff } [AcceptVerbs(HttpVerbs.Post)] public ActionResult Create(FormCollection collection) { // do post stuff } The Django Book suggests something like this: def method_splitter(request, ...

Do you check HttpVerbs in your unit tests?

Hi, While looking at the unit tests that come with the standard ASP.MVC Web Project template, I noticed that these do not test whether or not a proper HttpVerbs attribute is set on each action method. It's very easy to test this with reflection, but the question is whether or not it It's worth the effort. Do you check HttpVerbs in you...

Sharepoint - Multiple document upload - HTTP 'post' verb not allowed

When attempting to upload any number of documents, including very small files, seems to succeed- but subsequently redirects to an error page indicating the following: /_layouts/error.aspx?ErrorText=The%20HTTP%20verb%20POST%20used%20to%20access%20path%20%27%2F%5Fvti%5Fbin%2Fshtml%2Edll%2FSiteCollectionDocuments%2FForms%2FUpload%2Easpx%27...

Incrementing resource counter in a RESTful way: PUT vs POST

I have a resource that has a counter. For the sake of example, let's call the resource profile, and the counter is the number of views for that profile. Per the REST wiki, PUT requests should be used for resource creation or modification, and should be idempotent. That combination is fine if I'm updating, say, the profile's name, becaus...

Is the HTTP 'HEAD' verb useful in web development?

I've read the w3.org spec on the 'HEAD' verb, and I guess I'm missing something. I can't see how it would be useful. Is the HTTP 'HEAD' verb useful in web development? If so, how? ...

REST - Modify Part of Resource - PUT or POST

I'm seeing a good bit of hand-waving on the subject of how to update only part of a resource (eg. status indicator) using REST. The options seem to be: Complain that HTTP doesn't have a PATCH or MODIFY command. However, the accepted answer on http://stackoverflow.com/questions/1672025/http-modify-verb-for-rest does a good job of show...

Why do i need PUT or DELETE Http Verbs ?

After the release of MVC 2, i have started to check and play with the new features. But i couldnt understand that why do i need to use PUT or DELETE verbs ? I have searched about it and read some articles but i couldnt get it. What is the main purpose of DELETE and PUT (and do they have any advantages rather than using a GET or POST me...

Assert that request verb is POST

How do you ensure early enough in the PHP request pipeline the verb is POST and deny others? ...

405 HTTP Error - PHP POST

Hi, I have a site running on windows server 2008. The site is HTML, and has two forms which POST to PHP scripts (both to send an email). This error comes up however when I click the submit button on the page "405 - HTTP verb used to access this page is not allowed. The page you are looking for cannot be displayed because an invali...

ASP.NET MVC - How to Create a RESTful Controller Scheme?

Hi Guys, If this is a duplicate, please let me know - because i had a quick look and couldn't find anything that really answers my question. I'm experimenting with ASP.NET MVC 2. Now coming from a Web Forms background, i only really dealt with HTTP GET and HTTP POST. I'm trying to see how i could apply GET/PUT/POST/DELETE to the respe...

How to automatically overload DELETE and PUT if they are not available by the client?

How can I detect at the startup of the application that a client doesn't support DELETE and PUT verbs and automatically overload the POST verb? On the server side, how can I redirect those overloaded POST verbs into the right actions? Say I have a DELETE request that is overriden, how do I call the appropriate function in the controller ...