python使用post方法上传fi

2024-04-19 19:39:22 发布

您现在位置:Python中文网/ 问答频道 /正文

我在通过wcap协议将文件导入日历时遇到问题。在文档中,{a1}说我应该使用POST方法。我试过了,但没有什么好结果。我不知道hov强迫它使用python


Tags: 文件方法文档协议a1post历时hov
1条回答
网友
1楼 · 发布于 2024-04-19 19:39:22

您提供的wcap引用包含示例POST数据。 将^{}函数与POST数据一起使用非常简单。在

urllib2.urlopen(url[, data][, timeout])

Open the URL url, which can be either a string or a Request object.

data may be a string specifying additional data to send to the server, or None if no such data is needed. Currently HTTP requests are the only ones that use data; the HTTP request will be a POST instead of a GET when the data parameter is provided. data should be a buffer in the standard application/x-www-form-urlencoded format. The urllib.urlencode() function takes a mapping or sequence of 2-tuples and returns a string in this format.

相关问题 更多 >