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

Client: allow default constructor #1698

Closed

Conversation

vmaffione
Copy link
Contributor

Allow default constructor for Client, to support use cases such as the following:

       [...]
       httplib::Client cli;

       switch (var) {
       case 1:
           cli = httplib::Client(host1);
           break;
       case 2:
           cli = httplib::Client(host2);
           break;
       case 3:
           cli = httplib::Client(host3);
           break;

           [...]
       }
       result = cli.Get(path);
       // use result
       [...]

There are ofc many ways to workaround this limitation, but it would be handy to have also this additional way to use the Client class.

@vmaffione vmaffione closed this Oct 24, 2023
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.

1 participant