REST API,将RTF文本项发布到Domino服务器

时间:2019-03-07 11:35:06

标签: rest post lotus-domino

我正在尝试使用Domino Domino Lotus Notes服务器(9.0.1FP8)的REST-API

它适用于简单的文本字段,但是如果我尝试将富文本项目添加为json,则多米诺服务器将仅接收文本字段,而富文本字段为空。

我尝试使用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发送,什么是“边界”?

您有什么想法吗,怎么了?

2 个答案:

答案 0 :(得分:2)

根据documentation from IBM,您需要使用PUT(而不是POST)来更新字段。

答案 1 :(得分:0)

稍作尝试后,我现在知道出了什么问题。如果我在地址http://localhost/Test/JSON_Views.nsf/api/data/documents?form=mainForm上执行POST,则可以使用附件。如果我使用http://localhost/Test/JSON_Views.nsf/api/data/collections/name/List?form=mainForm&computewithform=true,则附件字段将被忽略。但是也许您可以向我解释一下,额外的字段边界是什么,以及是否可以通过附件的名称设置contentLocation?