Skip to content
Snippets Groups Projects
Commit 47ea0daa authored by Thomas Schneider's avatar Thomas Schneider
Browse files

CreateRecord: more debugging log, hopefully

parent 11ca0a61
Branches
Tags
No related merge requests found
Pipeline #4170 passed
......@@ -3,6 +3,7 @@ package rwthdns
import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
"strings"
......@@ -155,9 +156,18 @@ func (c *Client) CreateRecord(content string) (Record, error) {
return Record{}, err
}
dec := json.NewDecoder(res.Body)
b, err := io.ReadAll(res.Body)
if err != nil {
return Record{}, err
}
bs := string(b)
dec := json.NewDecoder(strings.NewReader(bs))
var r Record
err = dec.Decode(&r)
if err != nil {
err = fmt.Errorf("Decode: %w (%s)", err, bs)
}
return r, err
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment