HTTP Methods

GET vs POST

GET and POST are the two most common HTTP methods. GET retrieves data; POST submits data to create or process a resource.

Side-by-side comparison

GETPOST
PurposeRetrieve dataSubmit / create data
Request bodyNo (params in URL)Yes
IdempotentYesNo
CacheableYesNot by default
Visible in URLYes (query string)No (body)
BookmarkableYesNo

When to use GET

  • Fetching/reading data
  • Search and filter parameters
  • Anything safe and repeatable

When to use POST

  • Creating resources or submitting forms
  • Sending sensitive or large payloads
  • Actions with side effects

Bottom line

Use GET to read data (safe, cacheable, idempotent) and POST to create or submit data with side effects. Never put sensitive data in a GET query string.

More comparisons