mirror of
https://github.com/tuna/tunasync.git
synced 2025-04-20 11:42:43 +00:00
14 lines
255 B
Go
14 lines
255 B
Go
package manager
|
|
|
|
import (
|
|
"bytes"
|
|
"encoding/json"
|
|
"net/http"
|
|
)
|
|
|
|
func postJSON(url string, obj interface{}) (*http.Response, error) {
|
|
b := new(bytes.Buffer)
|
|
json.NewEncoder(b).Encode(obj)
|
|
return http.Post(url, "application/json; charset=utf-8", b)
|
|
}
|