首页 > 解决方案 > 如何从露天获得 Json 响应

问题描述

我正在尝试获取 alfresco json 响应,但到目前为止我得到了这种响应

对于这样的端点:

https://exaple.com/alfresco/webdav/Directory1/subDirectory1/

<html>
   <head>
      <meta content="HTML Tidy for Java (vers. 26 sept. 2004), see www.w3.org" name="generator"/>
      <title>Alfresco Content Repository</title>
      <style type="text/css">body { font-family: Arial, Helvetica; font-size: 12pt; background-color: white; }
table { font-family: Arial, Helvetica; font-size: 12pt; background-color: white; }
.listingTable { border: solid black 1px; }
.textCommand { font-family: verdana; font-size: 10pt; }
.textLocation { font-family: verdana; font-size: 11pt; font-weight: bold; color: #2a568f; }
.textData { font-family: verdana; font-size: 10pt; }
.tableHeading { font-family: verdana; font-size: 10pt; font-weight: bold; color: white; background-color: #2a568f; }
.rowOdd { background-color: #eeeeee; }
.rowEven { background-color: #dddddd; }</style>
   </head>
   <body>
      <table width="100%" border="0" cellpadding="3" cellspacing="2">
         <tr>
            <td class="textLocation" colspan="4">Directory listing for /Directory1/subDirectory1</td>
         </tr>
         <tr>
            <td colspan="4" height="10"/>
         </tr>
      </table>
      <table class="listingTable" width="100%" border="0" cellpadding="3" cellspacing="2">
         <tr>
            <td width="*" class="tableHeading">Name</td>
            <td width="10%" class="tableHeading">Size</td>
            <td width="20%" class="tableHeading">Type</td>
            <td width="25%" class="tableHeading">Modified Date</td>
         </tr>
         <tr class="rowOdd">
            <td class="textData" colspan="4">
               <a href="/alfresco/webdav/Directory1">[Up a level]</a>
            </td>
         </tr>
         <tr class="rowEven">
            <td class="textData">
               <a href="/alfresco/webdav/Directory1/subDirectory1/File.ini">File.ini</a>
            </td>
            <td class="textData">21.7 Kb</td>
            <td class="textData">Plain Text</td>
            <td class="textData">Thu, 09 Jan 2020 11:51:45 GMT</td>
         </tr>
         <tr class="rowOdd">
            <td class="textData">
               <a href="/alfresco/webdav/Directory1/subDirectory1/File2.OLB">File2.OLB</a>
            </td>
            <td class="textData">502.2 Kb</td>
            <td class="textData">application/x-tika-msoffice</td>
            <td class="textData">Tue, 09 Nov 2021 08:00:35 GMT</td>
         </tr>

      </table>
   </body>
</html>

我怎么能得到一个 json 响应而不是一个 html 响应。

我正在阅读有关 cmis 的表格,但找不到回复

当我使用 CMIS 时,使用此端点

https://exaple.com/alfresco/api/-default-/public/cmis/versions/1.1/atom

我收到了这样的回复:

<html>
<h1>Axis HTTP Servlet</h1>
Hi, you have reached the AXIS HTTP Servlet. Normally you would be hitting this URL with a SOAP client rather than a
browser.
<p>In case you are interested, my AXIS transport name appears to be '<b>http</b>'

</html>

注意,我没有指定文件夹

我是露天的新手

标签: restalfresco

解决方案


推荐阅读