This commit is contained in:
Manuel Rüger
2023-01-05 11:30:22 +01:00
parent bde4b70242
commit 8deecfd67a
4 changed files with 40 additions and 15 deletions

View File

@@ -89,7 +89,10 @@ func (tracer *tracer) Printf(format string, args ...interface{}) {
func NewAPI(baseURL string, username string, password string) *API {
var auth *gopencils.BasicAuth
if username != "" {
auth = &gopencils.BasicAuth{username, password}
auth = &gopencils.BasicAuth{
Username: username,
Password: password,
}
}
rest := gopencils.Api(baseURL+"/rest/api", auth)
if username == "" {