Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d6c3570ae7 |
@@ -4,6 +4,7 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -36,7 +37,7 @@ func Get(uri string, authName string, authValue string, queries map[string]strin
|
|||||||
return response, nil
|
return response, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func Post(uri string, authName string, authValue string, data any) (*http.Response, error) {
|
func Post(uri string, authName string, authValue string, data io.Reader) (*http.Response, error) {
|
||||||
jsonBytes, err := json.Marshal(data)
|
jsonBytes, err := json.Marshal(data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -61,7 +62,7 @@ func Post(uri string, authName string, authValue string, data any) (*http.Respon
|
|||||||
return response, nil
|
return response, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func Put(uri string, authName string, authValue string, data any) (*http.Response, error) {
|
func Put(uri string, authName string, authValue string, data io.Reader) (*http.Response, error) {
|
||||||
jsonBytes, err := json.Marshal(data)
|
jsonBytes, err := json.Marshal(data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
Reference in New Issue
Block a user