Skip to content

Commit

Permalink
Merge pull request #17 from glaslos/export_get_request
Browse files Browse the repository at this point in the history
exporting MakeAPIGetRequest
  • Loading branch information
williballenthin authored Oct 13, 2016
2 parents ae37159 + 74eed8b commit 0c6f6bc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions govt.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,11 +320,11 @@ func (client *Client) checkApiKey() (err error) {
}
}

// makeApiGetRequest fetches a URL with querystring via HTTP GET and
// MakeAPIGetRequest fetches a URL with querystring via HTTP GET and
// returns the response if the status code is HTTP 200
// `parameters` should not include the apikey.
// The caller must call `resp.Body.Close()`.
func (client *Client) makeApiGetRequest(fullurl string, parameters map[string]string) (resp *http.Response, err error) {
func (client *Client) MakeAPIGetRequest(fullurl string, parameters map[string]string) (resp *http.Response, err error) {
if err = client.checkApiKey(); err != nil {
return resp, err
}
Expand Down Expand Up @@ -464,7 +464,7 @@ func (client *Client) fetchApiJson(method string, actionurl string, parameters P
var resp *http.Response
switch method {
case "GET":
resp, err = client.makeApiGetRequest(theurl, parameters)
resp, err = client.MakeAPIGetRequest(theurl, parameters)
case "POST":
resp, err = client.makeApiPostRequest(theurl, parameters)
case "FILE":
Expand All @@ -490,7 +490,7 @@ func (client *Client) fetchApiJson(method string, actionurl string, parameters P
func (client *Client) fetchApiFile(actionurl string, parameters Parameters) (data []byte, err error) {
theurl := client.Url + actionurl
var resp *http.Response
resp, err = client.makeApiGetRequest(theurl, parameters)
resp, err = client.MakeAPIGetRequest(theurl, parameters)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -607,7 +607,7 @@ func readData(br *bufio.Reader) (line []byte, err error) {
func (client *Client) GetFileFeed(packageRange string) ([]FileFeed, error) {
var resp *http.Response
feedElements := []FileFeed{}
resp, err := client.makeApiGetRequest(client.Url+"file/feed", Parameters{"package": packageRange})
resp, err := client.MakeAPIGetRequest(client.Url+"file/feed", Parameters{"package": packageRange})
if err != nil {
return feedElements, err
}
Expand Down

0 comments on commit 0c6f6bc

Please sign in to comment.