Python Curl:HTTP/1.1 100继续文件上载消息

Python Curl:HTTP/1.1 100继续文件上载消息,python,django,curl,django-file-upload,Python,Django,Curl,Django File Upload,我在我的一个django项目中使用curl上传了一个文件,它在localhost中运行良好,但当我在远程服务器中托管该项目时,它不起作用 我正在从这个命令发送文件 curl -i --form docfile=@/path_to_file http://example.com/process-file 在views.py中,我以 def process_file(request): if request.method != 'POST': return HttpResp

我在我的一个django项目中使用curl上传了一个文件,它在localhost中运行良好,但当我在远程服务器中托管该项目时,它不起作用

我正在从这个命令发送文件

curl -i --form docfile=@/path_to_file http://example.com/process-file
在views.py中,我以

def process_file(request):
    if request.method != 'POST':
        return HttpResponseNotAllowed('Only POST Method')

    docfile = request.FILES['docfile']

    output = main(0, docfile) # output is json object
    return HttpResponse(output,content_type = "application/json")
当我在本地机器上运行时,这工作得非常好,但向远程服务器发送POST请求时返回curl

HTTP/1.1 100 Continue
什么也不做。文件正在上载。我该怎么办

谢谢

编辑1:
我试图从其他视图方法发送一些其他HttpResponse(文件名),它工作正常,但当我处理文件时,它只发送HTTP/1.1 100 Continue

我不知道如何在项目中解决这个问题,但看起来您的
curl
正在发送
Expect:100 Continue
头,提示远程服务器发回
HTTP/1.1 Continue
curl
等待返回响应,然后上载表单。你说
curl
返回
HTTP/1.1100 Continue
然后“什么也不做”,但它实际上应该在收到后上传,所以可能你使用的任何回调都不会返回。我会试着用Wireshark看看