我有一个 Spring REST API,我已经在 Postman 上测试过它,它返回完全有效的 JSON。但是,当我在前端 React 代码上调用相同的 API 时,它会返回 HTML。这是函数,我用来调用 API,
export function run(engine, mediaId, owner, target, access){
let url = engine + "/" + mediaId + "?id=" + owner + "&targetId=" + target + "&access=" + access;
return fetch(full_url, { credentials: "include",
headers: {
"Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
}})
.then((response) => {
return response.json();})
.then((data) => {
console.log(data);
})
.catch((error) => {
console.log(error);
});
}
Run Code Online (Sandbox Code Playgroud)
我在此调用中遇到语法错误Unexpected token < Thus when I check using response.text()我可以看到返回的数据是 HTML 而不是 …
这是我的ArrayList
ArrayList< HashMap < String,String> > list = new ArrayList<>();
Run Code Online (Sandbox Code Playgroud)
它包含hashmap.
如何获取Plain JSONArray中的所有哈希映射?
我的问题是图像!!!!我将此表的 html 导出到 excel,但图像未导出到表中。
<table class="order-table table sortable" id="tableadmin">
<thead>
<tr>
<th style="width:8px; min-width:8px; max-width:8px;">ID</th>
<th>Télépro</th>
<th>Date RDV</th>
<th>Heure RDV</th>
<th>Fiche</th>
<th style="width:170px; min-width:170px; max-width:170px;">Compterendu</th>
<th style="width:250px; min-width:250px;">Commentaire commercial</th>
</tr>
</thead>
<tbody id="changetable" class="new">
<tr>
<td>
<?php echo $id ?>
</td>
<td>
<?php echo $login ?>
</td>
<td>
<?php echo $date ?>
</td>
<td>
<?php echo $heure ?>
</td>
<td><img src="../img/fiche.png" />
</td>
<td>
<?php echo $compterendu ?>
</td>
<td>
<?php echo $comment ?>
</td>
</tr>
</tbody>
</table>Run Code Online (Sandbox Code Playgroud)