1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-01 17:38:37 +00:00

Move HTTP client to its own package

This commit is contained in:
Frédéric Guillot 2018-04-28 10:51:07 -07:00
parent 04adf5fdf5
commit 1eba1730d1
13 changed files with 64 additions and 64 deletions

View file

@ -8,7 +8,7 @@ import (
"fmt"
"net/url"
"github.com/miniflux/miniflux/http"
"github.com/miniflux/miniflux/http/client"
)
// Client represents an Instapaper client.
@ -24,8 +24,9 @@ func (c *Client) AddURL(link, title string) error {
values.Add("title", title)
apiURL := "https://www.instapaper.com/api/add?" + values.Encode()
client := http.NewClientWithCredentials(apiURL, c.username, c.password)
response, err := client.Get()
clt := client.New(apiURL)
clt.WithCredentials(c.username, c.password)
response, err := clt.Get()
if response.HasServerFailure() {
return fmt.Errorf("instapaper: unable to send url, status=%d", response.StatusCode)
}