1
0
Fork 0

add release functionality

This commit is contained in:
Cyborus 2023-11-17 13:31:36 -05:00
parent 51d4f42f43
commit 6f5f95dc23
No known key found for this signature in database
3 changed files with 135 additions and 0 deletions

View file

@ -95,6 +95,16 @@ impl Forgejo {
self.execute(request).await
}
async fn post_form<T: Serialize, U: DeserializeOwned>(
&self,
path: &str,
body: &T,
) -> Result<U, ForgejoError> {
let url = self.url.join("api/v1/").unwrap().join(path).unwrap();
let request = self.client.post(url).form(body).build()?;
self.execute(request).await
}
async fn delete(&self, path: &str) -> Result<(), ForgejoError> {
let url = self.url.join("api/v1/").unwrap().join(path).unwrap();
let request = self.client.delete(url).build()?;