A couple of minor changes
This commit is contained in:
@@ -4,7 +4,7 @@ import (
|
||||
"encoding/json"
|
||||
"flag"
|
||||
"fmt"
|
||||
"github.com/thequux/pdns-auto-update/common"
|
||||
"github.com/thequux/qddns/common"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"os"
|
||||
@@ -16,6 +16,7 @@ var domain = flag.String("domain", "", "The domain to update")
|
||||
var token = flag.String("token", "", "The authorization token")
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
req, err := http.NewRequest("POST", *server+"/update/"+*domain, strings.NewReader(""))
|
||||
|
||||
if err != nil {
|
||||
@@ -26,10 +27,12 @@ func main() {
|
||||
resp, err := http.DefaultClient.Do(req)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stdout, "Failed to send request: %v", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
body, err := ioutil.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Failed to read response")
|
||||
os.Exit(1)
|
||||
}
|
||||
rj := common.Response{}
|
||||
json.Unmarshal(body, &rj)
|
||||
|
||||
Reference in New Issue
Block a user