Groups
Groups
Sign in
Groups
Groups
Django REST framework
Conversations
About
Send feedback
Help
How to use CURL to simulate POST request with file upload?
1,230 views
Skip to first unread message
zhangxiao
unread,
Mar 19, 2012, 9:30:47 AM
3/19/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django-rest-framework
I have a form with one file field and I set it as `form` of my view.
It' works well with the HTML interface when I test in a browser. In
command line I also want to make it work with CURL but no luck.
Does anyone know how to do that? thanks!
Yaniv Aknin
unread,
Mar 19, 2012, 9:42:09 AM
3/19/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django-res...@googlegroups.com
Assuming the form field is "
my_form_field
", and the file's name is "
/tmp/my_file.jpg
" and the URL is
http://www.myhost.com/some_path
, then:
curl -Fmy_form_field=@/tmp/my_file.jpg
http://www.myhost.com/some_path
Reply all
Reply to author
Forward
0 new messages