summaryrefslogtreecommitdiff
path: root/bilibili/util.go
diff options
context:
space:
mode:
authorKeuin <[email protected]>2022-09-07 02:48:46 +0800
committerKeuin <[email protected]>2022-09-07 02:48:46 +0800
commit8e15d802865ed57db0018c15ea5559c8bd44c01f (patch)
tree48f4632a1ad044bd7f7f8da3ebe2bb03ab4ca6fe /bilibili/util.go
parent88234ca8fffc4e120adbe0d38071b625ad2f43c7 (diff)
First working version. Just a POC.
Diffstat (limited to 'bilibili/util.go')
-rw-r--r--bilibili/util.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/bilibili/util.go b/bilibili/util.go
new file mode 100644
index 0000000..1267a39
--- /dev/null
+++ b/bilibili/util.go
@@ -0,0 +1,13 @@
+package bilibili
+
+import (
+ "fmt"
+ "net/http"
+)
+
+func validateHttpStatus(r *http.Response) (err error) {
+ if code := r.StatusCode; code != http.StatusOK {
+ err = fmt.Errorf("unsuccessful HTTP status on API %v: %v", r.Request.URL, code)
+ }
+ return
+}