local-ch / lhc

🚀 Advanced HTTP Client for Ruby. Fueled with interceptors.
GNU General Public License v3.0
43 stars 1 forks source link

Do not assume hashes when trying to get data from body #139

Closed 10xSebastian closed 5 years ago

10xSebastian commented 5 years ago

Targeting 10.0.2 Backport as 9.4.4

In https://github.com/local-ch/lhc/releases/tag/v9.4.3 I introduced the assumption, that the passed body is always a Hash.

Turns out LHS passes LHS::Data and LHS::Record down to LHC as bodies.

This PR fixes the compatibility to LHS and allows custom structures to be passed, as long as they respond to as_json.