0

Which REST verb should I use to compute my request? POST or PUT. For example:
Request:

{
  start:[
    "1",
     "2"
  ], 
    end: [
    "2",
    "3"
  ]
}

Response:

{
  new:[
   "3"
  ],
  stayed: [
   "2"
  ],
  gone: [
   "1"
  ]
}
Himanshu Yadav
  • 13,315
  • 46
  • 162
  • 291

2 Answers2

0

Since your request is nullipotent, you should use GET. You can send the data as a JSON query parameter.

Here is a helpful Q&A about how to do generate a URL containing a query parameter.

Community
  • 1
  • 1
cybersam
  • 63,203
  • 6
  • 53
  • 76
0

Please provide more info about what you're doing/intending to do to help us out. That being said, when using REST calls, GET, PUT, POST, and DELETE perform the basic CRUD operations. GET returns a value, PUT updates an existing value, POST creates a new value, and DELETE deletes a value. This applies to any format (XML, JSON, etc). For adding new values to a server, use POST if the value doesn't already exist on the server and PUT if it does but you want to update its value(s). I hope this helps. If you need more help, please provide more background info on what you're trying to do.

jeffkempf
  • 288
  • 1
  • 3
  • 11