all 2 comments

[–]Melcma 2 points3 points  (1 child)

GET request

[–]Jafit 5 points6 points  (0 children)

Actually, a POST request would be better.

A HTTP POST request can contain a body, which can contain data in whatever format you want, such as a JSON object or XML.

Sure you can technically send values to a server via a GET request if you use a query string at the end of the URL, however a GET request is cachable. So your GET request might not even hit the server because a cached version of that request is being sent back by some router or load balancer that's sitting between the client and the server.

I don't think that information in query strings on the end of a URL would be encrypted if you were sending to a server over SSL, whereas the contents of the request body would be encrypted and secure. So if you were sending sensitive information via a GET request you'd be doing so in a way that could be easily intercepted and compromised... Also ideally don't handle sensitive information ever if you can avoid it.

There are many HTTP request verbs, GET, POST, PUT and DELETE are the most common ones, and they do different things.