add release functionality
This commit is contained in:
parent
51d4f42f43
commit
6f5f95dc23
3 changed files with 135 additions and 0 deletions
10
src/lib.rs
10
src/lib.rs
|
|
@ -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()?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue