Skip to content
This repository has been archived by the owner on Jun 8, 2019. It is now read-only.

ListPullRequestsOptions does not work? #161

Open
quantonganh opened this issue Apr 19, 2019 · 2 comments · May be fixed by #162
Open

ListPullRequestsOptions does not work? #161

quantonganh opened this issue Apr 19, 2019 · 2 comments · May be fixed by #162
Labels

Comments

@quantonganh
Copy link

return prs, c.getParsedResponse("GET", fmt.Sprintf("/repos/%s/%s/pulls", owner, repo), jsonHeader, bytes.NewReader(body), &prs)

How does this work?

func (c *Client) getParsedResponse(method, path string, header http.Header, body io.Reader, obj interface{}) error {

func (c *Client) getResponse(method, path string, header http.Header, body io.Reader) ([]byte, error) {

func (c *Client) doRequest(method, path string, header http.Header, body io.Reader) (*http.Response, error) {

You passed body as a JSON to a GET request and expect it will be converted to a query string?

@lunny lunny added the kind/bug label Apr 19, 2019
@lunny
Copy link
Member

lunny commented Apr 19, 2019

I think give a body param to a GET request is not a normal usage. But I have tested tea pulls, see https://github.com/go-gitea/tea, it works.

@quantonganh
Copy link
Author

@lunny Have you tried tea pulls with a repo which has no open pull requests? go-gitea/tea#17

@quantonganh quantonganh linked a pull request Apr 19, 2019 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants