forked from alemi/upub
fix: add json header otherwise we get html
This commit is contained in:
parent
4e45e359b2
commit
ef54867369
1 changed files with 4 additions and 1 deletions
|
@ -111,7 +111,10 @@ impl From<serde_json::Value> for Node<serde_json::Value> {
|
|||
impl Node<serde_json::Value>{
|
||||
pub async fn fetch(&mut self) -> reqwest::Result<()> {
|
||||
if let Node::Link(link) = self {
|
||||
*self = reqwest::get(link.href())
|
||||
*self = reqwest::Client::new()
|
||||
.get(link.href())
|
||||
.header("Accept", "application/json")
|
||||
.send()
|
||||
.await?
|
||||
.json::<serde_json::Value>()
|
||||
.await?
|
||||
|
|
Loading…
Reference in a new issue