When to Use Post?

When to Use Post?

In plain English, that means that GET is used for viewing something, without changing it, while POST is used for changing something. For example, a search page should use GET, while a form that changes your password should use POST.

When should POST be used?

A POST would be used for any operation which is neither safe or idempotent . Typically a POST would be used to create a new resource for example creating a NEW SO question (though in some designs a PUT would be used for this also). If you run the POST twice you would end up creating TWO new questions.

Should I use put or POST?

Use PUT when we want to modify a singular resource that is already a part of resources collection. PUT replaces the resource in its entirety. ... Use POST when you want to add a child resource under resources collection. Though PUT is idempotent, we should not cache its response.

Maya Lin-Takahashi
Author

Maya Lin-Takahashi

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.