Intern Track Roadmap

HTTP verb: POST

This course covers the HTTP POST method, used to send new data to a server. It explains why POST is neither safe nor idempotent, how the request body and the Content-Type header carry data, and what the server sends back, including 201 Created, the Location header and the Post/Redirect/Get pattern. It shows HTML forms, file uploads and JSON payloads for APIs. It also covers HTTPS, CSRF attacks and tokens, and how Rails handles POST requests with create, params, Strong Parameters and form_with.

What you'll learn

  • ✓Why POST requests change server state and are not idempotent
  • ✓How the request body and the Content-Type header work
  • ✓Responses with 201 Created, the Location header and Post/Redirect/Get
  • ✓Sending HTML forms, multipart file uploads and JSON payloads
  • ✓Protecting POST requests with HTTPS, CSRF tokens and SameSite cookies
  • ✓Handling POST in Rails with create, params, Strong Parameters and form_with
Free preview · Lesson 1 2 min read

What is the POST method?

While the GET method is for reading data, the POST method is for sending new data to the server.

Read the full lesson free →

Curriculum

7 lessons
Type to start searching...