Skip to content

Instantly share code, notes, and snippets.

@zeddee
Last active August 7, 2019 11:00
Show Gist options
  • Save zeddee/094feae779c0e81e4071701caa4a2d02 to your computer and use it in GitHub Desktop.
Save zeddee/094feae779c0e81e4071701caa4a2d02 to your computer and use it in GitHub Desktop.
POST requests more secure than GET requests?
  • Was inspecting a REST API reference, and found that all requests are POST requests.
  • Reason given was that POST requests are more secure than GET requests, presumably because you don't send data in the URL query
  • But...insufficient reason?
  • API key is sent in header.
  • Otherwise no difference in the interface; comes down to how the REST API server resolves the request.
  • POST requests are usually used to create resources.
    • https://restfulapi.net/idempotent-rest-apis/
    • Each POST request creates a new resource on the server, and is therefore not expected to be idempotent
    • So having all REST endpoints as POST endpoints is weird because then does that mean we're creating resources on the server?
    • not RESTFUL to implement POST endpoints for read-only operations?
    • GET usually implements read-only idempotent operations.

API keys

Other resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment