REST API,POST Rich Text Item到Domino服务器

问题描述 投票:1回答:2

我正在尝试使用我的多米诺莲花笔记本服务器的REST-API(9.0.1FP8)

它适用于简单的文本字段,但如果我尝试将富文本项添加为json,则domino服务器仅接收文本字段,而richt-text字段为空。

我尝试使用Postman和postrequest到http://localhost/Test/JSON_Vie ... s / name / List?form = mainForm,在那里我发送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发送,什么是“边界”?

你知道吗,出了什么问题?

rest post lotus-domino
2个回答
2
投票

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


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?

© www.soinside.com 2019 - 2024. All rights reserved.