Questions tagged [http-method]

HTTP methods used to designate the appropriate action to direct a server towards a resource. GET and POST are the most widely known; PATCH and DELETE also fit in that category, among others.

355 questions
3
votes
2 answers

Passing complex parameters into a GET request

I have a [HttpGet] web api method called GetCats() that returns a collection of Cat objects. I added parameters skip and take to allow pagination. However the requirements have increased and now there must be the possibility of complex filtering, in…
NibblyPig
  • 51,118
  • 72
  • 200
  • 356
3
votes
3 answers

XHR doesn't work because "Origin is not allowed by Access-Control-Allow-Origin"

I'm working on a API-Server with Rails 3 wich is pretty handy so far but I'm running across a error all the time and I'm not sure wether it is because of my Apache Setup or the Rails App. When I try to do a HTTP DELETE or PUT request on…
Phil
  • 43
  • 1
  • 4
3
votes
1 answer

How do I allow POST to a list_route, but not to the entire ViewSet?

I have a Game model and am doing the corresponding REST routes for it, e.g. GET /game, GET /game/1, etc. I only want API consumers to GET existing games. I don't want them to be able to POST new games arbitrarily. Rather, they should have to go…
Claudiu
  • 224,032
  • 165
  • 485
  • 680
3
votes
1 answer

Create a custom Http method

Is it possible to create our own HTTP method by just overriding the HttpMethodAttribute class and specify our own supportedMethods ? In fact, depending on the case, we need to return the View as complete view with the _Layout, and sometimes we just…
Christophe Gigax
  • 3,211
  • 4
  • 25
  • 37
3
votes
2 answers

How to define HTTP method and status code of Login and Logout?

I give an common user login/logout example about discussing HTTP method and status code. I hope It can help people to understand easily. Traditional no restful api design: When user login/logout a website, it's sure to access backend service by…
Burger King
  • 2,945
  • 3
  • 20
  • 45
3
votes
5 answers

Are REST API's really RESTful?

I'm new to this game so I might be misunderstanding things. Actually, if someone tells me that I'm misunderstanding things, it will be a favor. Maybe this person will be considerate enough to show me the right path. But... One of the "guidelines" or…
Dentra Andres
  • 371
  • 1
  • 7
  • 18
3
votes
2 answers

HTTP method to use when processing client data to produce output

I have a requirement to add an endpoint to my API to read a large encrypted input file and return some decrypted metadata from the file. The ideal solution to me would be to use a GET endpoint and take the encrypted blob in as a query parameter, but…
Siddhu
  • 888
  • 3
  • 9
  • 28
3
votes
1 answer

PUT method (RESTful) doesn't work as a way to update resources

According to this article(http://restcookbook.com/HTTP%20Methods/put-vs-post/), PUT is supposed to work as a method to update resources. However, practicing RESTful with JAX_RS 2.0 and Jersey 2.0, I don't think it updates a particular…
Hiroki
  • 3,893
  • 13
  • 51
  • 90
3
votes
3 answers

How to declare both method in routing.yml Symfony2?

I want to declare both methods GET and POST for a same route in my routing.yml. According the documentation it's possible with annotations like that : /** * @Route("/edit/{id}") * @Method({"GET", "POST"}) */ But how to YAML ? I tried different…
Antoine Subit
  • 9,803
  • 4
  • 36
  • 52
3
votes
2 answers

AngularJs http method override PUT-POST

IS there a way to do the http method override with angular's $resource service using the X-HTTP-Method-Override or a _method param in the request?
rascio
  • 8,968
  • 19
  • 68
  • 108
3
votes
1 answer

What are OPTIONS, LINK and UNLINK routes in Sinatra?

Sinatra routes documentation is too short: options '/' do .. appease something .. end link '/' do .. affiliate something .. end unlink '/' do .. separate something .. end I've been searching for REST docs and HTTP methods. I've found some…
Sony Santos
  • 5,435
  • 30
  • 41
3
votes
3 answers
3
votes
1 answer

How can I test multi-part uploads with FlaskClient (for unit testing)

The docs don't talk much about these, just basic params with PUT/POST/GET/DELETE, but I have a multipart upload that accompanies PUT, how can I do test it? Thanks!
nubela
  • 1
  • 24
  • 75
  • 123
2
votes
1 answer

security-constraint in web.xml not working with http-method - Tomcat in a Docker container

I have read several of the other answers and have tried a couple of suggestions, but no matter what I have tried to this point I am unable to exclude OPTIONS as an allowed http-method for TOMEE/TOMCAT running in a Docker container. The web.xml file…
Jay Blanchard
  • 34,243
  • 16
  • 77
  • 119
2
votes
1 answer

How to use different middlewares for get and post methods in Next js api?

With express we can use different middlewares for get and post requests, eg. // GET method route app.get('/users', function (req, res) { // handle get request }) // POST method route app.post('/users', auth, function (req, res) { //…