This commit is contained in:
2024-12-25 20:13:02 +01:00
parent eff6338f71
commit 0fcccf93b0
131 changed files with 20710 additions and 106 deletions

View File

@@ -22,6 +22,27 @@ mut conn := HTTPConnection{
}
```
## important: How to use it on a management class e.g. an installe or a client
```v
// e.g. HetznerManager is the object on which we want to have an http client
pub fn (mut h HetznerManager) connection() !&httpconnection.HTTPConnection {
mut c := h.conn or {
mut c2 := httpconnection.new(
name: 'hetzner_${h.name}'
url: h.baseurl
cache: true
retry: 3
)!
c2.basic_auth(h.user, h.password)
c2
}
return c
}
```
## Examples
### GET Request with JSON Response