Commit 477a662f authored by Corentin Barreau's avatar Corentin Barreau
Browse files

Fix: Feed endpoint, pass size as query param

parent 4549a671
......@@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"net/http"
"strconv"
)
func (c *Client) Feed(size int) (feedResponse *FeedResponse, err error) {
......@@ -16,6 +17,10 @@ func (c *Client) Feed(size int) (feedResponse *FeedResponse, err error) {
return feedResponse, err
}
q := req.URL.Query()
q.Add("size", strconv.Itoa(size))
req.URL.RawQuery = q.Encode()
req.Header.Add("X-Auth-Key", c.Key)
req.Header.Add("X-Auth-Secret", c.Secret)
req.Header.Add("User-Agent", "gocrawlhq/"+Version)
......
......@@ -40,7 +40,7 @@ func Init(key, secret, project, HQAddress string) (c *Client, err error) {
DiscoveredEndpoint.Path = path.Join(DiscoveredEndpoint.Path, "discovered")
FinishedEndpoint.Path = path.Join(FinishedEndpoint.Path, "finished")
FeedEndpoint.Path = path.Join(FeedEndpoint.Path, "feed")
FeedEndpoint.Path = path.Join(FeedEndpoint.Path, "feed", c.Project)
return c, nil
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment