From deed8eb64d78f51acedfb1cc857d675efd0e0f80 Mon Sep 17 00:00:00 2001 From: Vegard Engen Date: Fri, 18 Apr 2025 21:13:57 +0200 Subject: [PATCH] Handle 201 Created as 200 OK --- unifi/unifi.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unifi/unifi.go b/unifi/unifi.go index 67b706f..b1e3d28 100644 --- a/unifi/unifi.go +++ b/unifi/unifi.go @@ -255,7 +255,7 @@ func (c *Client) do_versioned(ctx context.Context, version, method, relativeURL c.csrf = resp.Header.Get("X-Csrf-Token") } - if resp.StatusCode != http.StatusOK { + if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusCreated { errBody := struct { Meta meta `json:"meta"` Data []struct {