Skip to content

Fix ambiguous Get() examples in README after new Params overload#2486

Merged
yhirose merged 5 commits into
masterfrom
copilot/fix-httplib-api-documentation
Jul 5, 2026
Merged

Fix ambiguous Get() examples in README after new Params overload#2486
yhirose merged 5 commits into
masterfrom
copilot/fix-httplib-api-documentation

Conversation

Copilot AI commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

The new Get(path, const Params&, ...) overload added ambiguity for existing call sites using bare brace-enclosed initializer lists, since Headers and Params are both multimap<std::string, std::string> typedefs. The README's own documented examples for Get() with headers no longer compile as a result.

Changes

  • Wrapped bare {{...}} initializer lists in explicit httplib::Headers{...} for all affected Get() examples in README.md:
    • "GET with HTTP headers" example
    • "Range" example (with make_range_header)
    • "Default Accept-Encoding value" examples (two call sites)

Example

// Before: ambiguous between Get(path, Params, progress) and Get(path, Headers, progress)
auto res = cli.Get("/hi", {{"Hello", "World!"}});

// After: explicit type disambiguates the call
auto res = cli.Get("/hi", httplib::Headers{{"Hello", "World!"}});

All updated snippets were compiled directly against httplib.h to confirm they no longer hit the "ambiguous call to overloaded function" error.

Copilot AI changed the title [WIP] Fix documentation mismatch for httplib.h API Add Get(path, params) convenience overload to match documented API Jul 4, 2026
Copilot AI requested a review from yhirose July 4, 2026 23:33
@yhirose yhirose marked this pull request as ready for review July 4, 2026 23:51
Copilot AI changed the title Add Get(path, params) convenience overload to match documented API Fix CI failures from new Get(path, params, progress) overload Jul 4, 2026
Copilot AI changed the title Fix CI failures from new Get(path, params, progress) overload Fix ambiguous Get() examples in README after new Params overload Jul 5, 2026
@yhirose yhirose merged commit 32abac3 into master Jul 5, 2026
42 of 43 checks passed
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.

2 participants