0
私は自分のコンピュータ(Ubuntuの10.04とPython 3.2)のhttp://docs.python.org/py3k/library/urllib.request.htmlからコードをテスト(URL =、データ)
>>> import urllib.request
>>> req = urllib.request.Request(url='https://localhost/cgi-bin/test.cgi',
... data=b'This data is passed to stdin of the CGI')
>>> f = urllib.request.urlopen(req)
>>> print(f.read().decode('utf-8'))
Got Data: "This data is passed to stdin of the CGI"
サーバー
python3 -m http.server
を使用次urlopen(REQ)として
GETメッセージ:?
......
ssl.SSLError: [Errno 1] _ssl.c:390: error:140770FC:SSLroutines:SSL23_GET_SERVER_HELLO:unknown protocol
During handling of the above exception, another exception occurred:
......
urllib.error.URLError: <urlopen error [Errno 1] _ssl.c:390: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol>
任意の提案どうもありがとう。
私のコードは次のように答えることに感謝します:url = 'https:// localhost:8000/cgi-bin/test.cgi'; handler = urllib.request.HTTPSHandler(url); opener = urllib.request.build_opener(ハンドラ); "urllib.error.HTTPError:HTTPエラー501:サポートされていないメソッド( 'POST')" – Steve
申し訳ありませんが、このメッセージは、私は今のところ知っている、それは私のせいだ。 – Steve
だから、答えは何ですか?この投稿に別の回答として投稿することができます。私はここで解決策を探しに来ましたが、何も見つかりませんでした。 – joar