还是没有过,吹水佬版主,您给的程序我是这样用的,第一步,增加一个程序,命名senddata, 然后粘贴您的代码如下:
PARAMETERS cUrl, cData &&这是我加的内容,因为不加就会出错。
LOCAL wh
wh = CREATEOBJECT("WinHttp.WinHttpRequest.5.1")
wh.Open("POST", cUrl, 0)
wh.SetRequestHeader("Accept", "application/json")
wh.SetRequestHeader("Content-Type", "application/json;charset=utf-8")
wh.Send(cData)
RETURN wh.ResponseText
第二步,又增加一个程序,命名“mycon”,粘贴代码如下:
程序代码:
SET PATH TO F:\CESHI
cUrl ="http://address:port/sms"
TEXT TO cData TEXTMERGE NOSHOW PRETEXT 7
{
"userName": "test",
"content": "【签名】您的验证码是 123456",
"phoneList": ["17307215711", "13500000002", "13500000003"],
"timestamp": 1596254400000,
"sign": "43fcac8cf3079f86f2f8409158c51ff6"
}
ENDTEXT
*? SendData(cUrl, cData)
SendData()
RETURN
接着,运行程序mycon,出现如下结果: