From 1eba1730d1af50ed545f4fde78b22d6fb62ca11e Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Sat, 28 Apr 2018 10:51:07 -0700 Subject: Move HTTP client to its own package --- integration/nunuxkeeper/nunuxkeeper.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'integration/nunuxkeeper') diff --git a/integration/nunuxkeeper/nunuxkeeper.go b/integration/nunuxkeeper/nunuxkeeper.go index 4627e8d..4ea5c45 100644 --- a/integration/nunuxkeeper/nunuxkeeper.go +++ b/integration/nunuxkeeper/nunuxkeeper.go @@ -9,7 +9,7 @@ import ( "net/url" "path" - "github.com/miniflux/miniflux/http" + "github.com/miniflux/miniflux/http/client" ) // Document structure of a Nununx Keeper document @@ -39,8 +39,10 @@ func (c *Client) AddEntry(link, title, content string) error { if err != nil { return err } - client := http.NewClientWithCredentials(apiURL, "api", c.apiKey) - response, err := client.PostJSON(doc) + + clt := client.New(apiURL) + clt.WithCredentials("api", c.apiKey) + response, err := clt.PostJSON(doc) if response.HasServerFailure() { return fmt.Errorf("nunux-keeper: unable to send entry, status=%d", response.StatusCode) } -- cgit v1.2.3