Shalean — service for sharing photos between users, to comment on the received work :)
Get overall site statistics for uploaded files and comments.
curl -G "http://localhost:8000/api/stat/"
Response body:
{
"Total_Images" : 3,
"Total_Unique_Images" : 3,
"Total_Size_Mb" : 0.2984,
"Total_Descriptons" : 3,
"Total_Unique_Descriptons" : 2
}
Upload new image to server
curl "http://localhost:8000/api/create_image/" -d "image=@/home/user1/Desktop/test.jpg"
Response body:
{
"id" : 13,
"image" : "http://127.0.0.1:8000/m/site_media/test.jpg"
}
Change a single image using the ID
curl -X PUT "http://localhost:8000/api/update_image/13" -d "image=@/home/user1/Desktop/test2.jpg"
Where 13 is image ID
Response body:
{
"id" : 13,
"image" : "http://127.0.0.1:8000/m/site_media/test2.jpg"
}
Get a single image using the ID
curl -G "http://localhost:8000/api/retrieve_image/13"
Where 13 is image ID
Response body:
{
"id" : 13,
"image" : "http://127.0.0.1:8000/m/site_media/test2.jpg"
}
Delete a single image using the ID
curl -X DELETE "http://localhost:8000/api/delete_image/13"
Where 13 is image ID
Response body:
{
}
Create new description for a standalone image
curl "http://localhost:8000/api/create_description/" -d "description=sueta&image=1"
Response body:
{
"id" : 5,
"description" : "sueta",
"image" : "1"
}
Change a single description using the ID
curl -X PUT "http://localhost:8000/api/update_description/1" -d "description=new"
Where 1 is description ID
Response body:
{
"id" : 1,
"description" : "new",
"image" : 1
}
Get a single description using the ID
curl -G "http://localhost:8000/api/retrieve_description/1"
Where 1 is description ID
Response body:
{
"id" : 1,
"description" : "safwa",
"image" : 1
}
Delete a single description using the ID
curl -X DELETE "http://localhost:8000/api/delete_description/1"
Where 1 is description ID
Response body:
{
}
Status Code | Description |
---|---|
200 | OK |
201 | CREATED |
400 | BAD REQUEST |
404 | NOT FOUND |
500 | INTERNAL SERVER ERROR |