0

I'm using DRF 2.3.13 , I want to upload photos by typing from terminal, so I use Httpie.

But I got MultiValueDict: {} , empty.

Am I missing the headers="multipart/form-data" ??

If true, so how to set the headers in Httpie??

Ex: I've sent it , but still get empty.

http -f -a username:password localhost:8000/photo/ FILES="path_to_image" author="AUTHOR" -h {'Content-Type':"multipart/form-data"}

tks for taking a look at this.

khue bui
  • 1,366
  • 3
  • 22
  • 30

1 Answers1

2
http -f -a username:password :8000/photo/ FILES@path_to_image author="AUTHOR"

See Request items and File upload forms for more details.

Jakub Roztocil
  • 15,930
  • 5
  • 50
  • 52