jiaowobaba
V2EX  ›  问与答

基于 python 的短信接口调用代码示例模板

  •  
  •   jiaowobaba · Sep 27, 2016 · 2129 views
    This topic created in 3514 days ago, the information mentioned may be changed or developed.

    阅信短信验证码平台最近会从新梳理基于不同语言的短信接口调用代码示例,是为了迎合市面上现在流行的各个语言代码实现,也是为了能够更好的服务满足客户的不同层次的需求。 下面的代码是基于 python 的短信接口调用代码示例模板,客户可拿来直接使用。 #coding=utf-8 import urllib import urllib2 import time import hashlib

    def md5(str): import hashlib m = hashlib.md5()
    m.update(str) returnm.hexdigest()

    url = 'http://IP;端口; timenew= time.strftime("%Y%m%d%H%M%S", time.localtime(time.time())) pwd = md5('**********'+timenew) values = {'name':'syncs','pwd':pwd,'content':' [阅信短信平台] 验证码 888888 ,千万不能告诉别人哦。','phone':'13381272353','subid':'','mttime':timenew} data = urllib.urlencode(values) req = urllib2.Request(url, data) response = urllib2.urlopen(req) the_page = response.read() print the_page

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5541 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 09:08 · PVG 17:08 · LAX 02:08 · JFK 05:08
    ♥ Do have faith in what you're doing.