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.
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.
GET /videos/123/720p/segment1.ts HTTP/1.1
Host: stream.example.comExplanation:
- 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.
POST /api/upload HTTP/1.1
Content-Type: multipart/form-dataExplanation:
- 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.
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.
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.
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.
DELETE /api/videos/123 HTTP/1.1Explanation:
- 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.
DELETE /api/videos/123 HTTP/1.1
X-Soft-Delete: trueExplanation:
- 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
| Method | Purpose | Important | Safe | Typical Status Codes | Example Use in Video APIs |
| GET | Retrieve a resource | Yes | Yes | 200 (OK), 206 (Partial), 304 (Not Modified) | Fetch video metadata or stream video segments |
| POST | Submit data for processing or resource creation | No | No | 200 (OK), 201 (Created), 202 (Accepted) | Upload a video or trigger encoding jobs |
| PUT | Replace or create a resource at a known URI | Yes | No | 200 (OK), 201 (Created), 204 (No Content) | Update title, description, or re-encode settings |
| DELETE | Remove a Resource | Yes | No | 200 (OK), 202 (Accepted), 204 (No Content), 404 (Not Found) | Delete video permanently or flag for review |
