【发布时间】:2019-03-08 20:39:05
【问题描述】:
我正在尝试使用我的 domino lotus notes 服务器 (9.0.1FP8) 的 REST-API
它适用于简单的文本字段,但如果我尝试将富文本项添加为 json,则 domino 服务器仅接收文本字段,而富文本字段为空。
我尝试使用 Postman 和对 http://localhost/Test/JSON_Vie...s/name/List?form=mainForm 的 Postrequest, 我发送 json 的地方
{
"title":"test rich text",
"artist":"rich texter",
"ntracks":1,
"attachments": {
"type": "multipart",
"content": [
{
"contentType": "multipart/alternative; Boundary=\"0__=4EBB0925DFBB40F18f9e8a93df938690918c4EBB0925DFBB40F1\"",
"contentDisposition": "inline"
},
{
"contentType": "text/plain; charset=US-ASCII",
"data": "test rich text",
"boundary": "--0__=4EBB0925DFBB40F18f9e8a93df938690918c4EBB0925DFBB40F1"
},
{
"contentType": "text/html; charset=US-ASCII",
"contentDisposition": "inline",
"data": "<html><body><font size=\"2\" face=\"sans-serif\"><b>test rich text</b></font></body></html>",
"boundary": "--0__=4EBB0925DFBB40F18f9e8a93df938690918c4EBB0925DFBB40F1"
}
]
}
}
掩码 mainForm 具有文本字段“title”、“artist”、“ntracks”和富文本字段“attachments”。
如何以 json 格式发送图像,什么是“边界”?
你有什么想法吗,怎么了?
【问题讨论】:
-
您使用的是 DAS 还是 ExtLib?
-
你试过这样简单的事情吗? "attachments":{"contentType":"text/html", "data":"测试富文本", "type":"richtext"}
-
@ThomasAdrian:我只是想测试一下简单的 html 代码。但实际上我想为每个 json 发送一个图像,但我不知道该怎么做。我使用 DAS。
-
@PerHenrikLausten 我尝试了您的简单 json 附件,但该字段仍然为空。
-
@PerHenrikLausten:这真的很有趣。如果我在现有文档上使用 put 并在 json 中添加我的附件字段,它就可以工作!在 POST 中是否有可能?
标签: rest post lotus-domino