diff options
| author | Shulhan <ms@kilabit.info> | 2022-04-22 23:17:32 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2022-04-22 23:30:56 +0700 |
| commit | 02abbfec6842d4ef7cc90cec37d0ffb4e39f6892 (patch) | |
| tree | 1cc6da04dba937ba2c7ed295293136648c900831 /client.go | |
| parent | 00ecc95e8af5d2e15927579894f2f92346453134 (diff) | |
| download | rescached-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.go | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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) } |
