第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

python不同版本中的urllib的問題!

python不同版本中的urllib的問題!

函數(shù)式編程 2019-02-18 00:38:36
import base64 import urllib2 class SGovToken(): TIME_OUT = 3600 LAST_UPDATE_TIME = "" TOKEN = '' def __init__(self, *args, **kwargs): pass def get_token_from_sgovernace(self,appid,appkey,url): if not appid or not appkey: return 'ERROE' soap_env = ''' <applicationID>{0}</applicationID> <credential>{1}</credential> ''' appkey = base64.standard_b64decode(appkey) soap_content = soap_env.format(appid,appkey) resquest = urllib2.Request(url,soap_content) resquest.add_header('SOPAACTION','getTokenByAPPCREdential') try: response = urllib2.urlopen(resquest) except HTTPERROR as e: pass if response is not none: resp_content = response.read() return resp_content 現(xiàn)在的代碼在python2中可以正常的獲取到resp_content....但是在python3中,將urllib2改為urllib.request卻是報錯的。urllib2.Request的data參數(shù)也改為了bytes類型?。?!不知道哪里還有問題呢?
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 1017 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號