July 2018
Intermediate to advanced
324 pages
8h 14m
English
Now we can add more photos to the existing record. The <indexentry content="Django REST API execution, in local environment:POST request on API "/albums//photos/"">following is the log snippet of the cRUL command execution, where we are uploading a image file to existing photo album:
$ curl -i -H "Content-Type: multipart/form-data" -H "Authorization: JWT eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VybmFtZSI6ImFiZHVsd2FoaWQiLCJleHAiOjE1Mjk1NzE5ODEsImVtYWlsIjoiYWJkdWx3YWhpZDI0QGdtYWlsLmNvbSJ9.3CHaV4uI-4xwbzAVdBA4ooHtaCdUrVn97uR_G8MBM0I" -X POST -F "image=@/home/abdulw/Pictures/serverless.png" http://localhost:8000/albums/1/photos/HTTP/1.1 201 CreatedDate: Thu, 21 Jun 2018 09:01:44 ...
Read now
Unlock full access