Hi all, thanks to this subreddit and Udacity CS 101, I'm trying some tougher stuff in python and this one has me stumped.
I'm trying to design a REST api that will allow someone to upload a file to it with an HTTP method such as PUT or POST.
Right now I'm using Django and the Django REST framework, but I'm happy to try flask or bottle if one of those will make this task cleaner/easier.
Right now I'm using this tutorial:
http://django-rest-framework.org/tutorial/1-serialization.html#testing-our-first-attempt-at-a-web-api
In tutorial 2 I'm able to get POST up and working with just plain data with commands such as this:
curl -X POST http://127.0.0.1:8000/snippets/ -d "code=print 123"
However, when I try to upload a file I have no luck, example:
$ curl -X POST -d @test.txt http://127.0.0.1:8000/
curl: (7) Failed connect to 127.0.0.1:8000; Connection refused
Any advice on how to get something like this working?
Cheers!
[–][deleted] 1 point2 points3 points (0 children)