aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--http.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/http.go b/http.go
index 5e5bebf..f92d15d 100644
--- a/http.go
+++ b/http.go
@@ -18,3 +18,15 @@ func Get(uri string, v interface{}) error {
}
return json.Unmarshal(body, v)
}
+
+func Post(uri string, v interface{}) error {
+ body, err := json.Marshal(v)
+ if err != nil {
+ return err
+ }
+ _, err := http.Post(uri, "application/jose+json", body)
+ if err != nil {
+ return err
+ }
+ return nil
+}