篮球比分直播网新浪: Python 調取短信驗證碼平臺---創藍253云通訊平臺

0
Python C/C++ Go 3214 次瀏覽

篮球比分188直播 www.703192.live #!/usr/local/bin/python
#-*- coding:utf-8 -*-
# Author: jacky
# Time: 14-2-22 下午11:48
# Desc: 短信http接口的python代碼調用示例
import httplib
import urllib

#服務地址
host = "sms.253.com"

#端口號
port = 80

#版本號
version = "v1.1"

#查賬戶信息的URI
balance_get_uri = "/msg/balance"

#智能匹配模版短信接口的URI
sms_send_uri = "/msg/send"

#創藍253賬號
un  = "xxxx"

#創藍密碼
pw = "xxxx"

def get_user_balance():
    """
    取賬戶余額
    """
    conn = httplib.HTTPConnection(host, port=port)
    conn.request('GET', balance_get_uri + "?un=" + un + "&pw=" + pw)
    response = conn.getresponse()
    response_str = response.read()
    conn.close()
    return response_str

def send_sms(text, phone):
    """
    能用接口發短信
    """
    params = urllib.urlencode({'un': un, 'pw' : pw, 'msg': text, 'phone':phone, 'rd' : '1'})
    headers = {"Content-type": "application/x-www-form-urlencoded", "Accept": "text/plain"}
    conn = httplib.HTTPConnection(host, port=port, timeout=30)
    conn.request("POST", sms_send_uri, params, headers)
    response = conn.getresponse()
    response_str = response.read()
    conn.close()
    return response_str 

if __name__ == '__main__':

    phone = "188xxxxxxxx"
    text = "【創藍253云通訊】您的驗證碼是1234"

    #查賬戶余額
    print(get_user_balance())

    #調用智能匹配模版接口發短信
    print(send_sms(text, phone))

 

 

請盡量讓自己的答案能夠對別人有幫助

9個答案

默認排序按投票排序
0

In you have the wrong function name. Although I’m not sure, since I’m just learning. I want to transfer my Windows 10 Themes site to Django

0

This PaperCoach reviews site is independent, and it was created for students who are looking for a reliable academic helper. They can read reviews from other learners and know more about the price policy, discounts, and special offers from PaperCoach.net.

0

Sleek work you have here. smart homes uk   smart homes uk

0

北京開發者中心 //010kfzzx.wikidot.com/
廣州開發者中心 //020kfzzx.wikidot.com/
上??⒄咧行?//021kfzzx.wikidot.com/
成都開發者中心 //028kfzzx.wikidot.com/
西安開發者中心 //029kfzzx.wikidot.com/
天津開發者中心 //022kfzzx.wikidot.com/
重慶開發者中心 //023kfzzx.wikidot.com/
沈陽開發者中心 //024kfzzx.wikidot.com/
南京開發者中心 //025kfzzx.wikidot.com/
武漢開發者中心 //027kfzzx.wikidot.com/
昆明開發者中心 //0871kfzzx.wikidot.com/
東莞開發者中心 //0769kfzzx.wikidot.com/
深圳開發者中心 //0755kfzzx.wikidot.com/
惠州開發者中心 //0752kfzzx.wikidot.com/
連云港開發者中心 //0518kfzzx.wikidot.com/

0


I have never seen a provider goes to the extremes that these guys do to help you get on board smoothly and help you get up and running quickly. Krunker

0

Hello, I would like to thank you for sharing this interesting information. As for me, it's quite correct that PYTHON makes such kind of verification. I had some experience related to it and I like it. It helped me in my https://ratewritingservices.com/review/mid-terms-com-review.html sample project.

0

Python is one language well suited to a beginner, and it is also widely used professionally, so a good choice. There are lots of tutorials and helpful Python and programming communities, use them.  Programming is simply based on logic. If you have the great sense of logic, you can start with virtually any language, along with.Net, Java etc. ... Students can still choose PYTHON as their first language, even without any programming background. It is because PYTHON has consistent and simple syntax and the vast library.  Visit this essay writing site.

 

0
Python is one language well suited to a beginner, and it is also widely used professionally, so a good choice. There are lots of tutorials and helpful Python and programming communities, use them.
0

Python can be really confusing at times. It reminds me of playing miniclip8.

相似問題

相關經驗

相關資訊

相關文檔

{ganrao} 黑龙江快乐十分走势图 北京快速赛车 山西十一选五走势图手机版 王中王资料精选九龙心水 山西快乐10分预测大师 九五至尊95055棋牌 河南十一选五赔奖率 福彩开奖公告查询 黑龙江快乐十分开奖号 友玩广西棋牌有挂吗 北京pk10投注方法稳赚 西甲直播网站 交钱推荐股票的公司靠谱吗 捕鱼达人旧版本下载 七星彩走势图表近30 江苏体彩七位数预测专家精选5注