Intern Track Roadmap

HTTP verb: PUT

This course explains the HTTP PUT method. It covers how PUT replaces a resource at a known URL or creates it there, and why the request body must hold the full representation. It explains idempotency and why it makes retries safe, then compares PUT with POST. Later lessons cover the status codes a PUT response returns, method spoofing for HTML forms that only support GET and POST, and how Rails routes PUT requests to the update action.

What you'll learn

  • ✓How PUT replaces or creates a resource at a specific URI
  • ✓What idempotency means and why it allows safe retries
  • ✓How PUT differs from POST in targeting and repeatability
  • ✓The status codes 200, 204 and 201 in PUT responses
  • ✓Method spoofing with a hidden _method field in HTML forms
  • ✓How Rails maps PUT requests to the update action
Free preview · Lesson 1 2 min read

What is the PUT method?

The HTTP PUT method has one job. It replaces the resource at a specific URL, or creates it if it doesn't exist yet.

Read the full lesson free →

Curriculum

7 lessons
Type to start searching...