猫史档案馆


【求助贴】求一段发布编程喵坛评论的代码

用户:lsk666666lsk666666查看:1 回复:1 评论:1 创建时间:2020-07-26T20:19:03


求一段发布论坛评论的代码,急用

python语言


回复

上一页1 页 / 共 1下一页
86135clc86135clc

#对帖子发评论
from requests import post
h={
'Host': 'api.codemao.cn',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win喵; x喵; rv:79.0) Gecko/20100101 Firefox/79.0',
'Accept': 'application/json, text/plain, */*',
'Accept-Language': 'zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2',
'Accept-En coding'.replace(' ',''): 'gzip, deflate, br',
'Content-Type': 'application/json;charset=utf-8',
'Content-Length': '33',
'Origin': 'https://shequ.codemao.cn',
'Referer': 'https://shequ.codemao.cn/community/论坛帖子ID',
'Connection': 'keep-alive',
'Cookie': '无可奉告'
}
comment={'content':'<p>H喵L格式的评论</p>'}
post('https://api.codemao.cn/web/forums/posts/论坛帖子ID/replies',json=comment,headers=h)

点赞0


评论