0

Can I use GET request instead of PUT to create resources?

Thanks in Advance

arihant jain
  • 43
  • 1
  • 1
  • 5
  • You can, but the only way to pass data in a GET request is by the URL itself. It would be pretty bad design. – dave823 Feb 12 '15 at 19:56
  • Down voters should provide some reason too. This seems like a reasonable doubt for a newbie. – EMM Jul 12 '17 at 05:52

2 Answers2

2

Yes. But it will surprise some people, and probably earn you some verbal abuse.

PaulProgrammer
  • 16,175
  • 4
  • 39
  • 56
  • 1
    And go against all the best practises. Maybe [this question](http://stackoverflow.com/questions/630453/put-vs-post-in-rest) is worth a read. – Donovan Solms Feb 11 '15 at 06:35
1

GET requests don't support bodies. So you can create stuff, but not using user input.

John Ament
  • 11,595
  • 1
  • 36
  • 45
  • Surprisingly, a lot of server side frameworks will allow a GET body, and some client side libraries will also generate a body if you ask nicely. But it does violate the specification and my own sense of all that is right with the world when GET is used this way. – PaulProgrammer Jul 12 '17 at 05:57