Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post params #23

Open
karalabe opened this issue Jan 23, 2015 · 1 comment
Open

Post params #23

karalabe opened this issue Jan 23, 2015 · 1 comment
Labels

Comments

@karalabe
Copy link

Hi,

A while back there was a fix to include query parameters in POST requests too (#12). There is a small inconsistency with the API now, in that Session.Post accepts a payload, but no params, meaning that I cannot - easily - set query parameters as for Get, but rather have to manually construct a request to add the parameters:

session.Get(url, &params, res, nil)

versus

req := &napping.Request{
    Method: "POST",
    Url:    url,
    Params: &params, // <- setting this one is missing from the API
    Result: res,
    Error:  nil,
}
rep, err := session.Send(req)
// ...

Cheers,
Peter

@jmcvetta
Copy link
Owner

The question I suppose is whether params should be an argument for all the verb methods. I don't have a real strong opinion on this.

However the change would break backward compatibility of the API. Maybe not an issue if gopkg or another versioning system has become popular enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants