Questions tagged [http-put]

HTTP PUT Uploads a representation of the specified resource.

HTTP PUT Uploads a representation of the specified resource.

277 questions
545
votes
13 answers

What is the difference between PUT, POST and PATCH?

What is the difference between PUT, POST and PATCH methods in HTTP protocol?
selva kumar
  • 5,553
  • 3
  • 11
  • 3
342
votes
6 answers

Should I use PATCH or PUT in my REST API?

I want to design my rest endpoint with the appropriate method for the following scenario. There is a group. Each group has a status. The group can be activated or inactivated by the admin. Should I design my end point as PUT…
java_geek
  • 17,585
  • 30
  • 91
  • 113
182
votes
3 answers

Content-Type header [application/x-www-form-urlencoded] is not supported on Elasticsearch

I used to have ElasticSearch 5.2, and just upgraded to 6.0. I am trying to create an index template following guide here, but got error Content-Type header [application/x-www-form-urlencoded] is not supported My query is curl -X PUT…
Barry Leishman
  • 1,823
  • 2
  • 7
  • 7
102
votes
10 answers

Javascript: Fetch DELETE and PUT requests

I have gotten outside of GET and POST methods with Fetch. But I couldn't find any good DELETE and PUT example. So, I ask you for it. Could you give a good example of DELETE and PUT methods with fetch. And explain it a little bit.
Kirill Stas
  • 1,359
  • 4
  • 12
  • 14
98
votes
4 answers

PHP cURL HTTP PUT

I am trying to create a HTTP PUT request with cURL and I can't make it work. I've read many tutorials but none of them actually worked. Here's my current code: $filedata = array('metadata' => $rdfxml); $ch = curl_init($url); $header = "Content-Type:…
user601513
  • 981
  • 1
  • 7
  • 3
90
votes
6 answers

How do I enable HTTP PUT and DELETE for ASP.NET MVC in IIS?

I use HTTP PUT and DELETE in my ASP.NET MVC3 application. When I run it in local, every thing works correctly; But when I publish the application to the server, these methods do not work. Are there any special settings for enable a web server to…
amiry jd
  • 27,021
  • 30
  • 116
  • 215
79
votes
6 answers

HTTP protocol's PUT and DELETE and their usage in PHP

Introduction I've read the following: Hypertext Transfer Protocol (HTTP) is the life of the web. It's used every time you transfer a document, or make an AJAX request. But HTTP is surprisingly a relative unknown among some web developers. The HTTP…
user4446130
26
votes
1 answer

Node.js - PUT with 'request' module

I am using the request module in Node.js to do a put request. My code looks like this var request = require('request'); var data = {foo: "bar", woo: "car"}; request({ method: 'PUT', uri: myURL, multipart: [{ …
MonsterWimp757
  • 1,197
  • 2
  • 14
  • 29
23
votes
4 answers

How to submit RESTful partial updates?

Sam Ruby, author of "RESTful Web Services" seems to come out against the use of HTTP PUT for partial updates: http://intertwingly.net/blog/2008/02/15/Embrace-Extend-then-Innovate What isn't clear is how partial updates should take place. As I…
Gili
  • 86,244
  • 97
  • 390
  • 689
21
votes
5 answers

How is a HTTP PUT request typically issued?

I know HTTP PUT is an idempotent request that store something at a specific URI, according to the definition (quoted from the rfc) The PUT method requests that the enclosed entity be stored under the supplied Request-URI. But what is the definition…
Jeffrey04
  • 6,138
  • 12
  • 45
  • 68
21
votes
2 answers

Using PUT and DELETE methods in Spring MVC

I'm trying to use RequestMethod.PUT and RequestMethod.DELETE in Spring MVC controller (version 3.0.2). There are three methods mapped with a URL in the Spring controller class as follows (PUT, GET and POST respectively, for the demonstration purpose…
Tiny
  • 27,221
  • 105
  • 339
  • 599
20
votes
4 answers

Can Spring MVC have request parameters for an HTTP PUT method, or must I use post? Which should I use to be RESTful?

I have a controller action I think should be an HTTP PUT, but Spring is complaining when I try and use @RequestParam in the controller action. Is request parameters not allowed for HTTP PUT methods, and is that why Spring is rejecting…
egervari
  • 22,372
  • 32
  • 121
  • 175
19
votes
3 answers

How do I handle file upload via PUT request in Django?

I'm implementing a REST-style interface and would like to be able to create (via upload) files via a HTTP PUT request. I would like to create either a TemporaryUploadedFile or a InMemoryUploadedFile which I can then pass to my existing FileField and…
user257111
15
votes
3 answers

Enable Http PUT requests on .NET MVC

I'm working on an MVC application. On my original draft of the service I had this method in one of my controllers: [AcceptVerbs(HttpVerbs.Post)] [ActionName("UpdateRelationship")] public ActionResult UpdateRelationship(string…
Bob Tway
  • 9,301
  • 17
  • 80
  • 162
14
votes
3 answers

PUT or DELETE verb in ASP.NET MVC on HTML form

I have a simple user registration form, with two fields, one for username and another for the password. I have a controller called UserController which has these two actions: [HttpGet] public ActionResult Register() { return…
Saeed Neamati
  • 35,341
  • 41
  • 136
  • 188
1
2 3
18 19