aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-11-27 01:00:07 +0100
committerDimitri Sokolyuk <demon@dim13.org>2015-11-27 01:00:07 +0100
commitb084114266ed0251abf3946f22ba64851e9b2c96 (patch)
tree1bf96ccdf785cad6b81ec6a8b578f12a1b64adc8
parent4aa78176f63ae6536542d724e6bfad5a8d559d00 (diff)
Add post stub
-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
+}