{% load static %}
Invoke-WebRequest -Uri "http://127.0.0.1:8000/video_upload_api/" -Method POST -InFile "path/to/your/vidoe/file.mp4"
curl -X POST -F "file=@path/to/your/video/file.mp4" http://127.0.0.1:8000/video_upload_api/
import requests
url = "http://127.0.0.1:8000/video_upload_api/"
files = {'file': open('path/to/your/video/file.mp4', 'rb')}
response = requests.post(url, files=files)
const url = 'http://127.0.0.1:8000/video_upload_api/';
const fileInput = document.querySelector('input[type="file"]');
const file = fileInput.files[0];
const formData = new FormData();
formData.append('file', file);
fetch(url, {
method: 'POST',
body: formData
})
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.json();
})
.then(data => {
console.log('Success:', data);
})
.catch(error => {
console.error('Error:', error);
});