How PUT, PATCH, and DELETE Methods work with Ruby on Rails

Jam
2 min readAug 24, 2020

HTTP Request methods:

Two commonly used request methods are GET and POST.

GET:

GET is used to request data from a specified resource.Note that the query string (name/value pairs) is sent in the URL of a GET request:/test/demo_form.php?name1=value1&name2=value2

POST:

POST is used to send data to a server to create/update a resource.

The data sent to the server with POST is stored in the request body of the HTTP request:POST /test/demo_form.php HTTP/1.1Host: w3schools.comname1=value1&name2=value2

[ Source: https://www.w3schools.com/tags/ref_httpmethods.asp ]

How PUT, PATCH, and DELETE methods work with Rails/ HTML form:

It is very easy to make different types of requests like PUT, DELETE, etc. with a rest client or mobile app or curl command line.

Commonly used requests methods in Rails are:

  • GET
  • POST
  • PUT
  • DELETE

--

--

Jam

Software engineer | Full Stack Developer | Programmer | Designer & Entrepreneur