Comments (4)
@bernzrdo JSON.stringify
return non-UTF-8 string.
Please change from
const data = JSON.stringify({
title: 'nova mensagem',
text: msg,
actions: [`responder|twitter://post?message=${msg} - bernzrdo.wtf`],
sound: 1
})
to
const data = new TextEncoder("utf-8").encode(JSON.stringify({
title: 'nova mensagem',
text: msg,
actions: [`responder|twitter://post?message=${msg} - bernzrdo.wtf`],
sound: 1
}))
Thanks.
from chanify.
I need more information:
- How to post request? (program or tools)
- POST request
Content-Type
- POST body
If Content-Type is appliaction/json
, send success.
If Content-Type is application/x-www-form-urlencoded
, please urlencoded characters.
Thank you very much.
from chanify.
Thank you for the quick reply.
I am using Node.js and application/json
. Here's a snippet of the code I am using:
const data = JSON.stringify({
title: 'nova mensagem',
text: msg,
actions: [`responder|twitter://post?message=${msg} - bernzrdo.wtf`],
sound: 1
})
const notifReq = https.request({
hostname: 'api.chanify.net',
port: 443,
path: '/v1/sender/' + process.env.CHANIFY_TOKEN,
method: 'POST',
headers: {
'Content-Type': 'application/json; charset=utf-8',
'Content-Length': data.length
}
}, notifRes=>{
var data = '';
notifRes.on('data', c=>data += c);
notifRes.on('end', ()=>{
data = JSON.parse(data);
if(!('request-uid' in data)) console.log(data);
res.render('twitter-result', { success: 'request-uid' in data });
});
});
notifReq.write(data);
notifReq.end();
from chanify.
It worked! Thank you very much! :)
from chanify.
Related Issues (20)
- feat: support gif image.
- feat: support tiff image.
- feat: support webp image.
- feat: custom notification sound.
- feat: add log for parse config file.
- fix: update database when update token.
- bug: iOS15.2,XR mobile Flashback HOT 2
- feat: action script example.
- bug: SSL 证书过期 HOT 2
- bug: Macos not receiving msg HOT 2
- 关于chanify.yml 配置文件的说明能不能在详细些呢
- python 发送带标题的告警 HOT 4
- feat: upload custom notify sound
- 该怎么新建频道呢? HOT 1
- feat: mac端可以增加注册账号功能吗? HOT 1
- feat: 可否增加对 Vercel Storage 的支持 HOT 2
- 关于发送动作的功能 HOT 1
- 推送过来的文件或者图片无法正常打开 HOT 2
- bug: iOS端chanify打开app 频道被重置
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chanify.