1
0

replace httplib with requests

This commit is contained in:
ThomasV
2015-06-10 08:29:50 +02:00
parent ddef165e18
commit 8bccf7b2db
4 changed files with 12 additions and 18 deletions

View File

@@ -17,9 +17,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import urllib
import httplib
import json
import sys
import requests
from PyQt4.QtGui import QMessageBox, QApplication, QPushButton
@@ -82,11 +82,9 @@ class Plugin(BasePlugin):
sig = self.wallet.sign_message(addr, message, password)
# 2. send the request
connection = httplib.HTTPSConnection('greenaddress.it')
connection.request("GET", ("/verify/?signature=%s&txhash=%s" % (urllib.quote(sig), tx.hash())),
None, {'User-Agent': 'Electrum'})
response = connection.getresponse()
response = json.loads(response.read())
response = requests.request("GET", ("/verify/?signature=%s&txhash=%s" % (urllib.quote(sig), tx.hash())),
headers = {'User-Agent': 'Electrum'})
response = response.json()
# 3. display the result
if response.get('verified'):