下面是我的代码:
import axios from 'axios';
const API = axios.create({ baseURL: 'https://api.scripture.api.bible' });
API.defaults.headers.common['api-key'] = 'MY_API_KEY';
API.defaults.headers.get['content-type'] = 'text';
API.defaults.headers.get['include-titles'] = false;
API.defaults.headers.get['include-verse-numbers'] = false;
export const getEnglishVerse = (verseId) => API.get(`/v1/bibles/65eec8e0b60e656b-01/verses/${verseId}`);
export const getItalianVerse = (verseId) => API.get(`/v1/bibles/41f25b97f468e10b-01/verses/${verseId}`);
The problem is that the last three headers don't work. There is the documentation: https://scripture.api.bible/livedocs#/Verses/getVerse
下面是我想要设置的:
在 Swagger 中一切都是好的,但我回应json的内容是这样的:
<p class="p"><span data-number="16" data-sid="JHN 3:16" class="v">16</span>Perciocchè Iddio ha tanto amato il mondo, ch'egli ha dato il suo unigenito Figliuolo, acciocchè chiunque crede in lui non perisca, ma abbia vita eterna. </p>
我只想在文本中的诗句,而不是在html(默认设置),但我的三个最后的标题,我试图设置错误。
你知道怎么做吗?
2条答案
按热度按时间3qpi33ja1#
content-type应该放在查询字符串中:...?内容类型=文本...
nkhmeac62#
你可以得到圣经这段代码
content-type
是文本仍然是测试版。它返回JSON即使设置文本。结果
此
curl
命令可获取所有圣经ID列表一个二个一个一个