HTTP methods define how a client communicates with a server and are essential to how video platforms manage content. Whether retrieving metadata, uploading a video, updating encoding settings, or deleting outdated content, each method (GET, POST, PUT, and DELETE) serves a specific role in the lifecycle of a video asset.

GET – Reading Data Without Changing It

The GET method is used to retrieve data from a server. It's read-only, it doesn’t modify anything on the server. Video platforms use GET to fetch video metadata, thumbnail images, playback URLs, and video chunks for streaming.

Fetching Video Metadata

Before a video plays, the platform often loads its title, description, tags, and duration. This populates the video card or detail page.

code
GET /api/videos/123 HTTP/1.1
Host: media.example.com
Accept: application/json

Explanation:

  • GET /api/videos/123: Requests metadata for video ID 123.
  • Host: The domain where the video content is stored.
  • Accept: application/json: Asks the server to return the data in JSON format.

Streaming Video Segments

Most modern platforms stream videos using adaptive bitrates and segmented playback. Each segment (or chunk) is delivered via a GET request.

code
GET /videos/123/720p/segment1.ts HTTP/1.1
Host: stream.example.com
code

Explanation:

  • GET /videos/123/720p/segment1.ts: Requests the first segment of video ID 123 in 720p resolution.
  • Host: The streaming server providing the content.

POST – Sending Data to Create Something New

The POST method is used to submit data to the server to create something new. On a video platform, POST is used for uploading videos, starting encoding jobs, or creating user-submitted comments or metadata.

Uploading New Video Content

When a user uploads a video file, the client sends the video data to the server using POST.

code
POST /api/upload HTTP/1.1
Content-Type: multipart/form-data
code

Explanation:

  • POST /api/upload: Initiates a video upload process.
  • Content-Type: Multipart/form-data: Indicates the request includes a file and accompanying metadata.

Starting Encoding Jobs

After uploading, videos need to be encoded into various formats (like 1080p, 720p) for different devices and network speeds. This is triggered via a POST request.

code
POST /api/encode HTTP/1.1
Content-Type: application/json

{
"source_uri": "s3://uploads/video123.mov",
"outputs": [
{ "resolution": "1080p", "codec": "h264" },
{ "resolution": "720p", "codec": "vp9" }
]
}

Explanation:

  • source_uri: Path to the original uploaded video file in cloud storage (e.g., S3).
  • outputs: List of desired encoding formats.
  • Each output includes a resolution and codec to define how the video should be processed.

PUT – Updating or Replacing Existing Data

The PUT method is used to update or replace an existing resource. On a video platform, this is used when updating video metadata or modifying encoding parameters for uploaded content.

Updating Video Metadata

If a content creator updates the title, description, or tags of their video, the platform uses a PUT request to replace the old data.

code
PUT /api/videos/123/metadata HTTP/1.1
Content-Type: application/json

{
"title": "New Title",
"description": "Updated video description",
"tags": ["education", "HD"]
}

Explanation:

  • PUT /api/videos/123/metadata: Updates the metadata of video ID 123.
  • The body includes the new title, description, and tags to overwrite existing values.

Reprocessing with New Encoding Settings

Sometimes a video needs to be re-encoded (e.g., changing the codec). A PUT request can be sent to update the job configuration.

code
PUT /api/encode/video123 HTTP/1.1
Content-Type: application/json

{
"outputs": [
{ "resolution": "4K", "codec": "h265" }
]
}

Explanation:

  • PUT /api/encode/video123: Updates encoding settings for video ID video123.
  • outputs: Specifies the new resolution and codec settings for the video to be reprocessed.

DELETE – Removing Data from the Server

The DELETE method is used to remove a resource from the server. Video platforms use it for removing uploaded content, clearing caches, or deleting outdated metadata.

Deleting Videos Permanently

When a user wants to remove their video, the platform sends a DELETE request targeting the specific video.

code
DELETE /api/videos/123 HTTP/1.1

Explanation:

  • DELETE /api/videos/123: Permanently deletes video ID 123 from the server and its associated metadata.

Using Soft Deletes for Safety

Many platforms prefer "soft deletes" to allow recovery later or to comply with moderation review workflows. This keeps the video in the system but makes it inaccessible to users.

code
DELETE /api/videos/123 HTTP/1.1
X-Soft-Delete: true
code

Explanation:

  • X-Soft-Delete: true: A custom header that tells the server to flag the video as deleted without immediately erasing it.

Differences Between Core HTTP Methods

MethodPurposeImportantSafeTypical Status CodesExample Use in Video APIs
GETRetrieve a resourceYesYes200 (OK), 206 (Partial), 304 (Not Modified)Fetch video metadata or stream video segments
POSTSubmit data for processing or resource creationNoNo200 (OK), 201 (Created), 202 (Accepted)Upload a video or trigger encoding jobs
PUTReplace or create a resource at a known URIYesNo200 (OK), 201 (Created), 204 (No Content)Update title, description, or re-encode settings
DELETERemove a ResourceYesNo200 (OK), 202 (Accepted), 204 (No Content), 404 (Not Found)Delete video permanently or flag for review