运行子程序(在Zotero中直接运行JavaScript代码)失败。解析表达式出错。
内部错误:响应状态代码不指示成功: 404 (Not Found)。
原始表达式:
//using System.Net.Http.Headers;
var client = new HttpClient();
var content = new StringContent({jscode});
content.Headers.ContentType = new MediaTypeHeaderValue("application/javascript");
var request = new HttpRequestMessage()
{
Method = HttpMethod.Post,
RequestUri = new Uri($"http://127.0.0.1:23119/debug-bridge/execute?password={{Password}.UrlEncode()}"),
Content = content
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
return body;
}(赋值)
(----新建文件v1:运行子程序----)
需要一些基本配置
1. 安装debug-bridge 插件(https://github.com/retorquere/zotero-better-bibtex/releases/download/debug-bridge/debug-bridge-6.7.79.emile.limonia.xpi) 或者【老版】
2. 菜单Tools—>Developer—>Run Javascript,运行如下代码(其中CTT为运行外部代码密码):
Zotero.Prefs.set("extensions.zotero.debug-bridge.password","CTT",true);
已经运行成功, 十分感谢