-
Notifications
You must be signed in to change notification settings - Fork 970
Open
Description
Using Ruby 3.0.4 and httparty 0.20.0
Here's an example API call:
db_call = HTTParty.patch("https://[MYSUBDOMAIN].supabase.co/rest/v1/streets?street_name=Main", headers: {
"apikey": ENV['SUPABASE_SECRET_KEY'],
"Authorization": "Bearer #{ENV['SUPABASE_SECRET_KEY']}",
"Content-Type": "application/json",
"Prefer": "return=representation"
}, body: JSON.generate({"street_id": 12345})
puts db_call.response.body # Prints a bunch of gzipped gibberish
sio = StringIO.new( db_call.response.body )
gz = Zlib::GzipReader.new( sio )
puts gz.read() # Prints the actual content
My understanding from the docs is that HTTParty automatically uncompresses gzipped responses as long as I don't explicitly specify an Accept-Encoding request header.
Why is that not happening here?
P.S. FWIW, I just tried a very similar HTTParty POST call (rather than PATCH) and the response came back uncompressed as expected.
zealot128
Metadata
Metadata
Assignees
Labels
No labels