【发布时间】:2012-10-19 12:00:05
【问题描述】:
我需要在 webpy 中通过 CURL 接收文件
import web
import json
class GetFile:
def POST(self):
try:
i = web.input()
data = web.data()
except Error(e):
print e
我不知道该怎么做,因为没有从 CURL 接收数据的示例
curl -o -H "Content-type: text/xml; charset=utf-8" -T doc.xml "http://localhost:8080/get_file
我遇到了问题
HTTP/1.1 405 Method Not Allowed
Content-Type: text/html
Allow: GET
Transfer-Encoding: chunked
Date: Fri, 19 Oct 2012 11:54:13 GMT
Server: localhost
谁能给我一个示例代码,通过 curl 上传文件并将其保存在某个位置。
【问题讨论】: