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:
parent
04adf5fdf5
commit
1eba1730d1
13 changed files with 64 additions and 64 deletions
|
@ -8,7 +8,7 @@ import (
|
|||
"fmt"
|
||||
"net/url"
|
||||
|
||||
"github.com/miniflux/miniflux/http"
|
||||
"github.com/miniflux/miniflux/http/client"
|
||||
)
|
||||
|
||||
// Client represents a Pinboard client.
|
||||
|
@ -30,8 +30,8 @@ func (c *Client) AddBookmark(link, title, tags string, markAsUnread bool) error
|
|||
values.Add("tags", tags)
|
||||
values.Add("toread", toRead)
|
||||
|
||||
client := http.NewClient("https://api.pinboard.in/v1/posts/add?" + values.Encode())
|
||||
response, err := client.Get()
|
||||
clt := client.New("https://api.pinboard.in/v1/posts/add?" + values.Encode())
|
||||
response, err := clt.Get()
|
||||
if response.HasServerFailure() {
|
||||
return fmt.Errorf("pinboard: unable to send bookmark, status=%d", response.StatusCode)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue