Questions tagged [http-verbs]

HTTP Verbs represent the request methods that are recognized as part of the Hypertext Transfer Protocol. These include but are not limited to POST, GET , PUT and DELETE.

219 questions
15
votes
5 answers

How to model a CANCEL action in a RESTful way?

We are currently in the process of wrangling smaller services from our monoliths. Our domain is very similar to a ticketing system. We have decided to start with the cancellation process of the domain. Our cancel service has as simple endpoint…
Karthik Balasubramanian
  • 1,127
  • 4
  • 13
  • 36
14
votes
2 answers

already defines a member called 'Create' with the same parameter types

I Have two method and distinct by http verb: public class ProductImageController : Controller { [HttpGet] public ViewResult Create(int productId) { return View(productId); } [HttpPost] public…
Mohammadreza
  • 3,139
  • 8
  • 35
  • 56
13
votes
3 answers

How does IsPostback technically work?

I'm currently having a strange issue whereby all browsers except from Google Chrome are registering a call to IsPostback within a Page_Load event as true when I click an asp.net button which simply posts back to the same page. This has led me to try…
Brian Scott
  • 9,221
  • 6
  • 47
  • 68
12
votes
4 answers

Defining Idempotence

So "idempotence" can be defined as: An action, that if performed N times has the same effect as performing the action only once. Got it, easy enough. My question is about the subtlety of this definition -is an action considered idempotent by itself,…
Didaxis
  • 8,486
  • 7
  • 52
  • 89
11
votes
5 answers

Is the HEAD response faster than the GET?

I'm currently getting the info about the files with GET, will it be faster if I rewrite it using HEAD request? Cause I close the connection after the first response.
blez
  • 4,939
  • 5
  • 50
  • 82
11
votes
5 answers

Using POST as a workaround for the URL character limit

If you have an API and support the POST operation only because of URL length limitations and the passing of complex parameters in the request, can you still say that you have a RESTful architecture? What the above basically implies is that for this…
Andreas Grech
  • 105,982
  • 98
  • 297
  • 360
9
votes
1 answer

Why does Stripe use the Post method for updating resources

According to the RFC Put is used to update an existing resource. But, the Stripe API uses Post to update objects. Why is this? For example, in the Stripe Node Library update: stripeMethod({ method: 'POST', path: '{id}', }), the update…
auerbachb
  • 857
  • 11
  • 25
8
votes
1 answer

Assert that request verb is POST

How do you ensure early enough in the PHP request pipeline the verb is POST and deny others?
Olaseni
  • 7,698
  • 16
  • 44
  • 68
8
votes
2 answers

How would I write an ActionFilter that ensures AntiForgeryTokens are used for every Post operation?

I want to use AntiForgeryTokens on every HttpPost Action using an ActionFilter that is in a controller named ControllerBase that every other controller inherits from. I want to do this by creating an ActionFilter that inherits from…
7
votes
4 answers

Confused about Http verbs

I get confused when and why should you use specific verbs in REST? I know basic things like: Get -> for retrieval Post -> adding new entity PUT -> updating Delete -> for deleting These attributes are to be used as per the operation I wrote above…
Jaggu
  • 6,298
  • 16
  • 58
  • 96
7
votes
3 answers

Why aren't the rest of the HTTP verbs used?

Most of the times, websites mainly only use GET and POST for all operations, yet there are seven more verbs out there. Where they used in older times but not so much now? Or maybe is it because some browsers don't recognize the other verbs? And if…
Andreas Grech
  • 105,982
  • 98
  • 297
  • 360
7
votes
3 answers

REST design for update/add/delete item from a list of subresources

I would like to know which is the best practice when you are having a resource which contains a list of subresources. For example, you have the resource Author which has info like name, id, birthday and a List books. This list of books exists only…
green
  • 153
  • 3
  • 13
7
votes
1 answer

Specify the DTO ID of a REST API PUT request in the body or URI?

With respect to REST and ASP.NET Web API, is it necessary to add the identifier to the route for a PUT action method even when the DTO payload (e.g., JSON) itself specifies the identifier? For example: public void Put(int id, [FromBody]SomeDto…
kwiri
  • 1,399
  • 2
  • 15
  • 22
7
votes
2 answers

How to handle stale data in REST?

For example, if I call GET to get an item, delete it with DELETE and GET it again, how should the second GET work? I mean, by correctly following REST principles, what is the right approach in doing this since GET can be cached and all? What's the…
JohnDoDo
  • 4,720
  • 8
  • 31
  • 47
6
votes
2 answers

Can ASMX be configured to respond to an HTTP 1.1 OPTIONS request?

It seems that ASMX implicitly does not allow the OPTIONS verb. I'm posting this question because I'm using jQuery AJAX calls with POST which first queries the server for available OPTIONS before the POST verb** is issued. By default Web.config maps…
John K
  • 28,441
  • 31
  • 139
  • 229
1
2
3
14 15