marklogic Rest api 扩展输出内容类型

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

我尝试为媒体编写一个 GET 服务。

当我上传媒体文件时,我使用

xdmp:document-filter
在文件的属性中存储元信息,如 content-type。 在 GET 中,我读取了这个属性文件并尝试将其放入回复的标题中。

   let $propertiesHtml := xdmp:document-get-properties($uri,fn:QName("http://www.w3.org/1999/xhtml","html"))
    let $content-type := $propertiesHtml/*/*:meta[@name='content-type']/@content/string()
    let $_ := map:put($context, "output-type", $content-type)

当我用 Postman 进行测试时,内容类型始终是:

application/x-unknown-content-type
而不是应有的
image/jpeg
(我在日志文件中跟踪它)。

我阅读了文档,但我了解如何做到这一点。

我测试该文件是否是 XML 文件,application/xml 是否已设置

rest marklogic
1个回答
0
投票

问题是输出类型 -> 输出类型的拼写错误带有“s”,复数,但我不知道为什么! 这是文档中的错误

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