aboutsummaryrefslogtreecommitdiff
path: root/client.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2022-04-22 23:17:32 +0700
committerShulhan <ms@kilabit.info>2022-04-22 23:30:56 +0700
commit02abbfec6842d4ef7cc90cec37d0ffb4e39f6892 (patch)
tree1cc6da04dba937ba2c7ed295293136648c900831 /client.go
parent00ecc95e8af5d2e15927579894f2f92346453134 (diff)
downloadrescached-02abbfec6842d4ef7cc90cec37d0ffb4e39f6892.tar.xz
all: changes the block.d update API request type to x-www-form-urlencoded
Instead of passing whole block.d object with single field Name set, send the request using urlencoded form.
Diffstat (limited to 'client.go')
-rw-r--r--client.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/client.go b/client.go
index 7d1fc86..02272c9 100644
--- a/client.go
+++ b/client.go
@@ -96,17 +96,17 @@ func (cl *Client) BlockdEnable(blockdName string) (an interface{}, err error) {
// provider based on registered URL.
func (cl *Client) BlockdUpdate(blockdName string) (an interface{}, err error) {
var (
- logp = "BlockdUpdate"
- hbReq = hostsBlock{
- Name: blockdName,
- }
- res = libhttp.EndpointResponse{}
+ logp = "BlockdUpdate"
+ params = url.Values{}
+ res = libhttp.EndpointResponse{}
hb *hostsBlock
resb []byte
)
- _, resb, err = cl.PostJSON(apiBlockdUpdate, nil, &hbReq)
+ params.Set(paramNameName, blockdName)
+
+ _, resb, err = cl.PostForm(apiBlockdUpdate, nil, params)
if err != nil {
return nil, fmt.Errorf("%s: %w", logp, err)
}