接口文檔

秒賽為開發者提供了詳細的API文檔和代碼示例,幫助開發者快速接入短信平臺

GO短信接口_GO短信發送代碼示例

2020-03-10 14:54:44 欄目:代碼示例 查看( )
本文分享go短信接口代碼,為方便用戶接入網站/app/各種系統,感興趣的小伙伴們可以參考一下。

package main
import (
    "net/http"
    "io/ioutil"
    "net/url"
    "fmt"
 )
func main(){
    //賬號
    account      := "***************"
    //密碼
    pswd      := "***************"
     // 修改為您要發送的手機號碼,多個號碼用逗號隔開
    mobile      := "***************"
    //短信內容
    contentyzm :="【秒賽科技】您的驗證碼是:1234"
     
     
    // 發送url,請咨詢客服
    url_send    := "xxxxxxxxxxxxxxxxxxx";
     
     
    data_send   := url.Values{"account": {account}, "pswd": {pswd},"mobile": {mobile},"msg":{msg},"needstatus":"true"}
     
    httpsPostForm(url_send,data_send)
     
}
func httpsPostForm(url string,data url.Values) {
    resp, err := http.PostForm(url,data)
    if err != nil {
        // handle error
    }
    defer resp.Body.Close()
    body, err := ioutil.ReadAll(resp.Body)
    if err != nil {
        // handle error
    }
    fmt.Println(string(body))
}
微信掃一掃

認證、簽名模板審核結果通知

賬號短信余額不足提醒

平臺促銷活動及最新資訊

鄭重申明:①任何個人和或機構在未經過本人同意的情況下,不得擅自轉載或大段引用到網站或者第三方平臺使用,對于擅自盜用文章將通過法律訴訟途徑等一切手段來解決!②部分素材來源于互聯網,如有侵權,請聯系作者刪除!