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

"Parameters" class lacks a method to add a parameter #58

Merged
merged 2 commits into from
Nov 4, 2015
Merged

"Parameters" class lacks a method to add a parameter #58

merged 2 commits into from
Nov 4, 2015

Conversation

mexus
Copy link
Contributor

@mexus mexus commented Nov 4, 2015

While writing an application which uses the cpr library I found impossible to add parameters to a request in a dynamic fashion.
For example, I have some parameters backed up in a std container, and I want to add all of them to the cpr::Parameters object, but I don't know the size of the container in advance.
Maybe I'm misleading something, maybe this funcionality already exists in the project, nevertheless I wasn't able to find it. Please correct me if I am wrong, but I think this simple patch can be useful.

@whoshuu
Copy link
Contributor

whoshuu commented Nov 4, 2015

Hey @mexus, this is a pretty good find. You're right, there's no way to change Parameters after its been instantiated, except through direct modification of the content member. If possible, can you add a test after this one that demonstrates the expected behavior?

@mexus
Copy link
Contributor Author

mexus commented Nov 4, 2015

@whoshuu , sure thing!

whoshuu added a commit that referenced this pull request Nov 4, 2015
"Parameters" class lacks a method to add a parameter
@whoshuu whoshuu merged commit 978a347 into libcpr:master Nov 4, 2015
@whoshuu
Copy link
Contributor

whoshuu commented Nov 4, 2015

Thanks @mexus, merged!

@mexus
Copy link
Contributor Author

mexus commented Nov 4, 2015

@whoshuu, wow, that's fast =) BTW, thank you for your nice lib! Finally we have some sane and true-c++ curl wrapper!

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

Successfully merging this pull request may close these issues.

None yet

2 participants