Clone
2
1.2 BACKEND APIs
Kshitij edited this page 2025-08-02 15:54:05 +05:30

BACKEND-APIs


Tip

-k in CURL allows for self-signed certificates.

Register

curl -k -X POST https://localhost:8080/api/auth/register   -H "Content-Type: application/json"   -d '{
  "email": "testHDFS@example.com",
  "password": "Pass@123",
  "username": "testHDFS3",
  "firstname": "Test",
  "lastname": "HDFS",
  "fullname": "Test HDFS"
}'

Login

curl -k -X POST https://localhost:8080/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "testHDFS@example.com",
    "password": "Pass@123"
  }'

File upload

curl -k -X POST https://localhost:8080/api/files/upload \
  -H "Authorization: Bearer $JWT" \
  -F "file=@/home/overnion/Desktop/Typing Speed/15-102-98.mp4"

File download

curl -k -X GET "https://localhost:8080/api/files/download" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $JWT" \
-d '{"filename": "15-102-98.mp4", "password": "Pass@123"}' \
--output 15-102-98.mp4