PB中使用https获取微信的AccessToken

2018-07-13 21:18:21
Reading:352
n_pbfunc_http lnv_http
lnv_http.of_clear()//清空参数
string ls_appId,ls_secret
ls_appId ="wx6c8ed522d20c65e1"//在微信公众号后台找出填入你自己的AppId(应用ID)
ls_secret="7c50d0ea547f738498839573d64bf1fe"//在微信公众号后台找出填入你自己的secret(应用密钥)
lnv_http.of_set_URL("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid="+ls_appId+"&secret="+ls_secret+"")
lnv_http.of_set_ContentType("application/json")
lnv_http.of_enableHttps(true)//启用https
Blob lblb_data
string ls_error
IF lnv_http.of_get(lblb_data,ls_error) Then
    n_pbfunc_encode lnv_encode
    string gbkData
    gbkData = lnv_encode.of_utf8ToGbk(lblb_data)//由于返回来的是utf-8编码,直接显示会乱码
    MessageBox("提示",gbkData)
Else
    MessageBox("提示","执行失败")
End IF

About

When I was young
I'd listen to the radio
Waiting for my favorite songs
When they played I'd sing along
It made me smile
Those were such happy times
And not so long ago
How I wondered where they'd gone
But they're back again
Just like a long lost friend
All the songs I loved so well