回答編集履歴

2

プロトコルを間違えていたので修正 http -> https

2016/07/25 11:20

投稿

matobaa
matobaa

スコア2493

test CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  なお `httplib.HTTPSConnection()` の第一引数は、URLではなくて ホスト名です。
6
6
 
7
- つまり、`http://` がつかない、`example.com` あるいは `example.com:443` のような。
7
+ つまり、`https://` がつかない、`example.com` あるいは `example.com:443` のような。
8
8
 
9
9
  [http://docs.python.jp/2/library/httplib.html#httplib.HTTPSConnection](http://docs.python.jp/2/library/httplib.html#httplib.HTTPSConnection)
10
10
 

1

HTTPSConnection の API について言及

2016/07/25 11:20

投稿

matobaa
matobaa

スコア2493

test CHANGED
@@ -1 +1,15 @@
1
1
  gaierrorが出ていますが、APIのURLは間違っていませんか。あるいはhttps用のプロキシを正しく設定できていないとか。
2
+
3
+
4
+
5
+ なお `httplib.HTTPSConnection()` の第一引数は、URLではなくて ホスト名です。
6
+
7
+ つまり、`http://` がつかない、`example.com` あるいは `example.com:443` のような。
8
+
9
+ [http://docs.python.jp/2/library/httplib.html#httplib.HTTPSConnection](http://docs.python.jp/2/library/httplib.html#httplib.HTTPSConnection)
10
+
11
+
12
+
13
+ URL形式で開くのでしたら、`urllib2.urlopen()` がつかえるかと。
14
+
15
+ [http://docs.python.jp/2/library/urllib2.html#urllib2.urlopen](http://docs.python.jp/2/library/urllib2.html#urllib2.urlopen)