RT @[email protected]

More #CrystalTips

need to read the body of an HTTP::Request, make sure you do not use .to_s, this will stringify the IO class ("HTTP::FixedLengthContent") and won't really read the data, what you should be doing instead is using body.try &.gets_to_end which returns String | Nil

🐦🔗: https://twitter.com/bararchy/status/1389624962370129927

Bar Hofesh on Twitter

“More #CrystalTips need to read the body of an HTTP::Request, make sure you do not use .to_s, this will stringify the IO class ("HTTP::FixedLengthContent") and won't really read the data, what you should be doing instead is using body.try &.gets_to_end which returns String | Nil”

Twitter