I need to implement the server side of a REST API that allows file
upload from client processes (not from browsers). The request is a
PUT, with an Expect: 100-Continue header (among other usual header
fields). This should allow the server to check the header fields and
abort the rest of the upload in case authentication fails or any
header is missing. How can I implement a handler for this in Django?
Anybody implemented 100-Continue handling?

It happens to be that the client script is also written in Python,
using the httplib library. I can debug it, but I am not supposed to
change its behavior. In other words, I have to support 100-Continue by
my server, I do not have a choice.

If I step through the sender script, I can see that my Django view
handler function is called right when the client executes the
http_connection.endheaders() method. I can see all the headers on the
server side. Then the client starts sending the file content with
repeated calls to http_connection.send(data), but on typically the
second call it receives an exception with a broken pipe: obviously the
server closed the connection. How do I send back the 100-Continue
response without loosing the connection? It seems that whatever I
return from the view handler method, the connection is closed right
away. Correct?

I only tested this on the built-in development server.

Any help would be appreciated.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to