diff options
author | Cyborus <cyborus@cyborus.xyz> | 2023-11-17 19:31:36 +0100 |
---|---|---|
committer | Cyborus <cyborus@cyborus.xyz> | 2023-11-17 19:31:36 +0100 |
commit | 6f5f95dc23d11109c0923ca10fbc6f3165472e63 (patch) | |
tree | 3c1f06cf288dcc62bf5af0ccef6e5c90bf0d0d20 /src/lib.rs | |
parent | Merge pull request 'add base pr functionality' (#4) from pr into main (diff) | |
download | forgejo-api-6f5f95dc23d11109c0923ca10fbc6f3165472e63.tar.xz forgejo-api-6f5f95dc23d11109c0923ca10fbc6f3165472e63.zip |
add release functionality
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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()?; |