aboutsummaryrefslogtreecommitdiffhomepage
path: root/integration/wallabag
diff options
context:
space:
mode:
authorGravatar Frédéric Guillot <fred@miniflux.net>2018-04-28 10:51:07 -0700
committerGravatar Frédéric Guillot <fred@miniflux.net>2018-04-28 10:51:07 -0700
commit1eba1730d1af50ed545f4fde78b22d6fb62ca11e (patch)
tree61f99282f66529b42625a8f335593bdcb461459c /integration/wallabag
parent04adf5fdf53951f270923c41171a52575db53e46 (diff)
Move HTTP client to its own package
Diffstat (limited to 'integration/wallabag')
-rw-r--r--integration/wallabag/wallabag.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/integration/wallabag/wallabag.go b/integration/wallabag/wallabag.go
index fbb100a..58d9c5b 100644
--- a/integration/wallabag/wallabag.go
+++ b/integration/wallabag/wallabag.go
@@ -10,7 +10,7 @@ import (
"io"
"net/url"
- "github.com/miniflux/miniflux/http"
+ "github.com/miniflux/miniflux/http/client"
)
// Client represents a Wallabag client.
@@ -38,8 +38,9 @@ func (c *Client) createEntry(accessToken, link, title string) error {
return fmt.Errorf("wallbag: unable to get entries endpoint: %v", err)
}
- client := http.NewClientWithAuthorization(endpoint, "Bearer "+accessToken)
- response, err := client.PostJSON(map[string]string{"url": link, "title": title})
+ clt := client.New(endpoint)
+ clt.WithAuthorization("Bearer " + accessToken)
+ response, err := clt.PostJSON(map[string]string{"url": link, "title": title})
if err != nil {
return fmt.Errorf("wallabag: unable to post entry: %v", err)
}
@@ -64,8 +65,8 @@ func (c *Client) getAccessToken() (string, error) {
return "", fmt.Errorf("wallbag: unable to get token endpoint: %v", err)
}
- client := http.NewClient(endpoint)
- response, err := client.PostForm(values)
+ clt := client.New(endpoint)
+ response, err := clt.PostForm(values)
if err != nil {
return "", fmt.Errorf("wallabag: unable to get access token: %v", err)
}