博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
python 调用短信接口
阅读量:4300 次
发布时间:2019-05-27

本文共 437 字,大约阅读时间需要 1 分钟。

主要技术是使用python 的 urllib2和urllib库

代码如下:

def send_sys(url, account, password, mobile, content):

    data = {}
    data['account'] = account         #测试了多家短信接口提供商,基本参数都是帐号,密码,接收手机号,内容(会稍有不没)。
    data['password'] = password
    data['mobile'] = mobile
    data['content'] = content
    #url = 'http://106.ihuyi.cn/webservice/sms.php?method=Submit'  这是我测试的短信接口发送url,每个短信接口提供商的url是不一样的

    data = urllib.urlencode(data)
    response = urllib2.urlopen(url, data)
    html = response.read()

转载地址:http://yxvws.baihongyu.com/

你可能感兴趣的文章
vue中的状态管理 vuex store
查看>>
Maven之阿里云镜像仓库配置
查看>>
Maven:mirror和repository 区别
查看>>
微服务网关 Spring Cloud Gateway
查看>>
SpringCloud Feign的使用方式(一)
查看>>
SpringCloud Feign的使用方式(二)
查看>>
关于Vue-cli+ElementUI项目 打包时排除Vue和ElementUI
查看>>
Vue 路由懒加载根据根路由合并chunk块
查看>>
vue中 不更新视图 四种解决方法
查看>>
MySQL 查看执行计划
查看>>
OpenGL ES 3.0(四)图元、VBO、VAO
查看>>
OpenGL ES 3.0(五)纹理
查看>>
OpenGL ES 3.0(八)实现带水印的相机预览功能
查看>>
OpenGL ES 3.0(九)实现美颜相机功能
查看>>
FFmpeg 的介绍与使用
查看>>
Android 虚拟机简单介绍——ART、Dalvik、启动流程分析
查看>>
原理性地理解 Java 泛型中的 extends、super 及 Kotlin 的协变、逆变
查看>>
FFmpeg 是如何实现多态的?
查看>>
FFmpeg 源码分析 - avcodec_send_packet 和 avcodec_receive_frame
查看>>
FFmpeg 新旧版本编码 API 的区别
查看>>