go-resty / resty

Simple HTTP and REST client library for Go
MIT License
10.01k stars 706 forks source link

feat: add way to set empty header on request #496 #876

Closed jeevatkm closed 1 week ago

jeevatkm commented 1 week ago

closes #496

The solution is not to use the method Get on the Header, which returns an empty string for a non-existing header key. Instead, check directly in the header map

codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.42%. Comparing base (c6cf259) to head (634b218). Report is 4 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #876 +/- ## ========================================== + Coverage 98.15% 98.42% +0.27% ========================================== Files 14 14 Lines 2329 2414 +85 ========================================== + Hits 2286 2376 +90 + Misses 23 20 -3 + Partials 20 18 -2 ``` | [Flag](https://app.codecov.io/gh/go-resty/resty/pull/876/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=go-resty) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/go-resty/resty/pull/876/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=go-resty) | `98.42% <100.00%> (+0.27%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=go-resty#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.