2016-08-10 18 views
0

サーバはマルチパート投稿リクエストの処理方法を知らず、境界に遭遇したときにエラーを投げるので、残りのサーバにデータを投稿できません。 pycurlにマルチ以外の投稿を作成する方法はありますか? なぜ投稿要求は複数の部分である必要がありますか?pycurlを使用した非マルチパート投稿

答えて

1

A POSTは確かに私もここに貼り付けるpycurlのドキュメントからthis exampleを参照して、マルチパートである必要はありません。

c = pycurl.Curl() 
c.setopt(c.URL, 'http://pycurl.io/tests/testpostvars.php') 

post_data = {'field': 'value'} 
# Form data must be provided already urlencoded. 
postfields = urlencode(post_data) 
# Sets request method to POST, 
# Content-Type header to application/x-www-form-urlencoded 
# and data to send in request body. 
c.setopt(c.POSTFIELDS, postfields) 

c.perform() 
c.close() 
関連する問題