diff options
| author | Shulhan <ms@kilabit.info> | 2021-03-14 22:51:01 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2021-03-14 22:51:46 +0700 |
| commit | 25fb633ee6ab446917af8dcd2f9b303e85a13c98 (patch) | |
| tree | 7e4b3aff5593498e31270c241e5a749a54f69ca8 /lib/http/example_server_test.go | |
| parent | e7552ad0189f761875bc1c2ca3dd716d43a01e0d (diff) | |
| download | pakakeh.go-25fb633ee6ab446917af8dcd2f9b303e85a13c98.tar.xz | |
all: refactoring http.Client methods signature
Previously, parameters to method Delete, Get, Post, PostForm, PostFormData,
PostJSON, Put, and PutJSON are in the following order:
(headers, path, params)
This is sometimes confusing. To make it better and works with format
of HTTP request header,
METHOD PATH
HEADERS
PARAMS
we move the path to the first parameter and headers as the second
parameter, so the call to client methods would be
(path, headers, params)
Diffstat (limited to 'lib/http/example_server_test.go')
| -rw-r--r-- | lib/http/example_server_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/http/example_server_test.go b/lib/http/example_server_test.go index 966d6b64..8ee7268a 100644 --- a/lib/http/example_server_test.go +++ b/lib/http/example_server_test.go @@ -58,7 +58,7 @@ func ExampleServer_customHTTPStatusCode() { client := NewClient("http://127.0.0.1:8123", nil, false) - httpRes, resBody, err := client.PostJSON(nil, epCustom.Path, nil) + httpRes, resBody, err := client.PostJSON(epCustom.Path, nil, nil) if err != nil { log.Fatal(err) } |
