We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 71af51e commit 021277eCopy full SHA for 021277e
src/api/news/get_body.rs
@@ -0,0 +1,19 @@
1
+use crate::api::news::News;
2
+use crate::blog_backend;
3
+use crate::infra::http::{body_or_err, RequestBuilderExt};
4
+use anyhow::Result;
5
+
6
+impl News {
7
+ pub async fn get_body(&self, id: usize) -> Result<String> {
8
+ let client = reqwest::Client::new();
9
10
+ let req = {
11
+ let url = blog_backend!("newsitems/{}/body", id);
12
+ client.get(url).pat_auth(&self.pat)
13
+ };
14
15
+ let resp = req.send().await?;
16
17
+ body_or_err(resp).await
18
+ }
19
+}
src/api/news/mod.rs
@@ -1,3 +1,4 @@
+pub mod get_body;
pub mod get_list;
pub struct News {
0 commit comments