Repaso
EspaƱol
Backend & APIsCoreAPI-33

What is the purpose of a GET request?

Options

  1. Create a new resource on the server side
  2. Retrieve data without changing anything (Correct option)
  3. Delete data that is stored on the server
  4. Upload files from the client to the server

Answer

Retrieve data without changing anything on the server

Why

GET asks the server for data. It must be 'safe': it should not create, change or delete anything.

Because of that, browsers, proxies and CDNs may cache and repeat GET requests freely.

Never use GET for actions like /delete-user?id=5: a crawler or prefetch could trigger it.

Remember

GET = read only.

Key terms

Practice this question in Repaso