Files
BaiLongma/scripts/send-test.mjs

14 lines
431 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 用 Node 发一条天气查询给 Agent避免 Windows curl 中文编码问题
const body = JSON.stringify({
from_id: 'ID:000001',
content: '帮我看一下北京今天的天气,用卡片显示',
channel: 'API'
})
const res = await fetch('http://127.0.0.1:3721/message', {
method: 'POST',
headers: { 'Content-Type': 'application/json; charset=utf-8' },
body
})
console.log('HTTP', res.status, await res.text())