镜像自地址
https://github.com/tuna/tunasync.git
已同步 2025-12-06 14:36:47 +00:00
14 行
255 B
Go
14 行
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)
|
|
}
|