HTTP/2 and UTF-8 body is not working together

Hello.

Thanks for you libs.

Just find out some issue with usage for httpx and json body, which contain non ascii symbols. Example:

Sending POST request with hash:

http_client = HTTPX.with(
  origin: secrets,
  base_path: another_secrets,
  timeout: {
    connect_timeout: 30,
    request_timeout: 60
  },
  headers: {
    'accept' => 'application/json',
    'content-type' => 'application/json'
  }
)
data = {description: "7022025 descrição"}
response = http_client.post('/payments', json: payload)

and get error:

(pid:23543 tid:2632, self:HTTPX::Resolver::Native#41624) resolver A: query for xxxxx.com
(pid:23543 tid:2632, self:HTTPX::Resolver::Native#41624) resolver A: server: udp://10.1.0.2:53...
(pid:23543 tid:2632, self:HTTPX::UDP#41640) WRITE: 35 bytes...
(pid:23543 tid:2632, self:HTTPX::UDP#41640) READ: 99 bytes...
(pid:23543 tid:2632, self:HTTPX::Resolver::Native#41624) resolver A: answer xxx.com: [#<IPAddr: IPv4:18.64.207.58/255.255.255.255>, #<IPAddr: IPv4:18.64.207.32/255.255.255.255>, #<IPAddr: IPv4:18.64.207.39/255.255.255.255>, #<IPAddr: IPv4:18.64.207.74/255.255.255.255>] (early resolve: false)
(pid:23543 tid:2632, self:HTTPX::Resolver::Native#41624) emit :resolve callbacks
(pid:23543 tid:2632, self:HTTPX::Resolver::Native#41624) emit :close callbacks
(pid:23543 tid:2632, self:HTTPX::SSL#41648)  idle -> idle
(pid:23543 tid:2632, self:HTTPX::SSL#41648) Connected to 18.64.207.74 (#7)
(pid:23543 tid:2632, self:HTTPX::SSL#41648) 18.64.207.74 connected -> negotiated

SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256
ALPN, server accepted to use h2
Server certificate:
 subject: /CN=*.xxxxx.com
 start date: 2024-11-18 00:00:00 UTC
 expire date: 2025-12-17 23:59:59 UTC
 issuer: /C=US/O=Amazon/CN=Amazon RSA 2048 M02
 SSL certificate verify ok.
(pid:23543 tid:2632, self:HTTPX::Connection#41656) emit :open callbacks
(pid:23543 tid:2632, self:HTTPX::SSL#41648) WRITE: 45 bytes...
(pid:23543 tid:2632, self:HTTPX::SSL#41648) READ: 40 bytes...
(pid:23543 tid:2632, self:HTTPX::SSL#41648) WRITE: 9 bytes...
(pid:23543 tid:2632, self:HTTPX::SSL#41648) READ: 9 bytes...
(pid:23543 tid:2632, self:HTTPX::Connection::HTTP2#41664) emit :current_timeout callbacks
(pid:23543 tid:2632, self:HTTPX::Connection::HTTP2#41664) 1: -> HEADER: accept: application/json
1: -> HEADER: content-type: application/json
1: -> HEADER: user-agent: Test
1: -> HEADER: access_token: xxx
1: -> HEADER: accept-encoding: gzip, deflate
1: -> HEADER: content-length: 267
1: -> HEADER: :scheme: https
1: -> HEADER: :method: POST
1: -> HEADER: :path: /api/v3/payments
1: -> HEADER: :authority: xxx.com
(pid:23543 tid:2632, self:HTTPX::Connection::HTTP2#41664) 1: -> DATA: 267 bytes...
(pid:23543 tid:2632, self:HTTPX::Connection#41656) emit :error callbacks
(pid:23543 tid:2632, self:HTTPX::Connection::HTTP2#41664) emit :error callbacks
(pid:23543 tid:2632, self:HTTPX::ErrorResponse#41672) /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/3.4.0/forwardable.rb:240:in 'String#<<': incompatible character encodings: BINARY (ASCII-8BIT) and UTF-8 (HTTP2::Error::ProtocolError)
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/3.4.0/forwardable.rb:240:in 'HTTPX::Buffer#<<'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/connection/http2.rb:350:in 'HTTPX::Connection::HTTP2#on_frame'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/emitter.rb:36:in 'block in HTTP2::Emitter#emit'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/emitter.rb:35:in 'Array#delete_if'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/emitter.rb:35:in 'HTTP2::Emitter#emit'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/connection.rb:461:in 'HTTP2::Connection#encode'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/flow_buffer.rb:96:in 'block in HTTP2::FlowBuffer#send_frame'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/connection.rb:841:in 'HTTP2::Connection#manage_state'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/flow_buffer.rb:94:in 'HTTP2::FlowBuffer#send_frame'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/flow_buffer.rb:77:in 'HTTP2::FlowBuffer#send_data'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/connection.rb:440:in 'HTTP2::Connection#send'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/client.rb:41:in 'HTTP2::Client#send'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/emitter.rb:36:in 'block in HTTP2::Emitter#emit'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/emitter.rb:35:in 'Array#delete_if'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/emitter.rb:35:in 'HTTP2::Emitter#emit'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/flow_buffer.rb:98:in 'block in HTTP2::FlowBuffer#send_frame'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/stream.rb:695:in 'HTTP2::Stream#manage_state'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/flow_buffer.rb:94:in 'HTTP2::FlowBuffer#send_frame'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/flow_buffer.rb:77:in 'HTTP2::FlowBuffer#send_data'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/stream.rb:205:in 'HTTP2::Stream#send'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/stream.rb:266:in 'HTTP2::Stream#data'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/connection/http2.rb:257:in 'HTTPX::Connection::HTTP2#join_body'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/connection/http2.rb:173:in 'block in HTTPX::Connection::HTTP2#handle'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/connection/http2.rb:169:in 'Kernel#catch'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/connection/http2.rb:169:in 'HTTPX::Connection::HTTP2#handle'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/connection/http2.rb:118:in 'HTTPX::Connection::HTTP2#send'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/connection/http2.rb:164:in 'HTTPX::Connection::HTTP2#send_pending'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/connection/http2.rb:357:in 'HTTPX::Connection::HTTP2#on_settings'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/emitter.rb:36:in 'block in HTTP2::Emitter#emit'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/emitter.rb:35:in 'Array#delete_if'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/emitter.rb:35:in 'HTTP2::Emitter#emit'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/connection.rb:678:in 'HTTP2::Connection#connection_settings'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/connection.rb:495:in 'HTTP2::Connection#connection_management'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/connection.rb:275:in 'HTTP2::Connection#receive'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/client.rb:46:in 'HTTP2::Client#receive'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/connection.rb:424:in 'HTTP2::Connection#<<'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/connection/http2.rb:98:in 'HTTPX::Connection::HTTP2#<<'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/connection.rb:442:in 'block (3 levels) in HTTPX::Connection#consume'
	from <internal:kernel>:168:in 'Kernel#loop'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/connection.rb:423:in 'block (2 levels) in HTTPX::Connection#consume'
	from <internal:kernel>:168:in 'Kernel#loop'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/connection.rb:392:in 'block in HTTPX::Connection#consume'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/connection.rb:390:in 'Kernel#catch'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/connection.rb:390:in 'HTTPX::Connection#consume'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/connection.rb:250:in 'HTTPX::Connection#call'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/selector.rb:185:in 'HTTPX::Selector#select_one'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/selector.rb:122:in 'HTTPX::Selector#select'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/selector.rb:38:in 'block in HTTPX::Selector#next_tick'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/selector.rb:30:in 'Kernel#catch'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/selector.rb:30:in 'HTTPX::Selector#next_tick'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/session.rb:313:in 'block (2 levels) in HTTPX::Session#receive_requests'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/session.rb:313:in 'Kernel#catch'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/session.rb:313:in 'block in HTTPX::Session#receive_requests'
	from <internal:kernel>:168:in 'Kernel#loop'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/session.rb:308:in 'HTTPX::Session#receive_requests'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/session.rb:283:in 'HTTPX::Session#send_requests'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/session.rb:106:in 'HTTPX::Session#request'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/chainable.rb:10:in 'HTTPX::Chainable#post'
	from (minum-web):17:in '<main>'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/irb-1.15.2/lib/irb/workspace.rb:101:in 'Kernel#eval'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/irb-1.15.2/lib/irb/workspace.rb:101:in 'IRB::WorkSpace#evaluate'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/irb-1.15.2/lib/irb/context.rb:591:in 'IRB::Context#evaluate_expression'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/irb-1.15.2/lib/irb/context.rb:557:in 'IRB::Context#evaluate'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/irb-1.15.2/lib/irb.rb:201:in 'block (2 levels) in IRB::Irb#eval_input'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/irb-1.15.2/lib/irb.rb:512:in 'IRB::Irb#signal_status'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/irb-1.15.2/lib/irb.rb:193:in 'block in IRB::Irb#eval_input'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/irb-1.15.2/lib/irb.rb:272:in 'block in IRB::Irb#each_top_level_statement'
	from <internal:kernel>:168:in 'Kernel#loop'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/irb-1.15.2/lib/irb.rb:269:in 'IRB::Irb#each_top_level_statement'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/irb-1.15.2/lib/irb.rb:192:in 'IRB::Irb#eval_input'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/irb-1.15.2/lib/irb.rb:173:in 'block in IRB::Irb#run'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/irb-1.15.2/lib/irb.rb:172:in 'Kernel#catch'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/irb-1.15.2/lib/irb.rb:172:in 'IRB::Irb#run'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/railties-8.0.2/lib/rails/commands/console/irb_console.rb:112:in 'Rails::Console::IRBConsole#start'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/railties-8.0.2/lib/rails/commands/console/console_command.rb:59:in 'Rails::Console#start'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/railties-8.0.2/lib/rails/commands/console/console_command.rb:8:in 'Rails::Console.start'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/railties-8.0.2/lib/rails/commands/console/console_command.rb:87:in 'Rails::Command::ConsoleCommand#perform'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/thor-1.3.2/lib/thor/command.rb:28:in 'Thor::Command#run'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/thor-1.3.2/lib/thor/invocation.rb:127:in 'Thor::Invocation#invoke_command'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/railties-8.0.2/lib/rails/command/base.rb:178:in 'Rails::Command::Base#invoke_command'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/thor-1.3.2/lib/thor.rb:538:in 'Thor.dispatch'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/railties-8.0.2/lib/rails/command/base.rb:73:in 'Rails::Command::Base.perform'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/railties-8.0.2/lib/rails/command.rb:65:in 'block in Rails::Command.invoke'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/railties-8.0.2/lib/rails/command.rb:143:in 'Rails::Command.with_argv'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/railties-8.0.2/lib/rails/command.rb:63:in 'Rails::Command.invoke'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/railties-8.0.2/lib/rails/commands.rb:18:in '<main>'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in 'Kernel#require'
	from bin/rails:6:in '<main>'
/Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/3.4.0/forwardable.rb:240:in 'String#<<': incompatible character encodings: BINARY (ASCII-8BIT) and UTF-8 (Encoding::CompatibilityError)
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/3.4.0/forwardable.rb:240:in 'HTTPX::Buffer#<<'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/connection/http2.rb:350:in 'HTTPX::Connection::HTTP2#on_frame'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/emitter.rb:36:in 'block in HTTP2::Emitter#emit'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/emitter.rb:35:in 'Array#delete_if'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/emitter.rb:35:in 'HTTP2::Emitter#emit'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/connection.rb:461:in 'HTTP2::Connection#encode'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/flow_buffer.rb:96:in 'block in HTTP2::FlowBuffer#send_frame'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/connection.rb:841:in 'HTTP2::Connection#manage_state'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/flow_buffer.rb:94:in 'HTTP2::FlowBuffer#send_frame'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/flow_buffer.rb:77:in 'HTTP2::FlowBuffer#send_data'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/connection.rb:440:in 'HTTP2::Connection#send'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/client.rb:41:in 'HTTP2::Client#send'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/emitter.rb:36:in 'block in HTTP2::Emitter#emit'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/emitter.rb:35:in 'Array#delete_if'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/emitter.rb:35:in 'HTTP2::Emitter#emit'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/flow_buffer.rb:98:in 'block in HTTP2::FlowBuffer#send_frame'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/stream.rb:695:in 'HTTP2::Stream#manage_state'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/flow_buffer.rb:94:in 'HTTP2::FlowBuffer#send_frame'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/flow_buffer.rb:77:in 'HTTP2::FlowBuffer#send_data'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/stream.rb:205:in 'HTTP2::Stream#send'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/stream.rb:266:in 'HTTP2::Stream#data'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/connection/http2.rb:257:in 'HTTPX::Connection::HTTP2#join_body'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/connection/http2.rb:173:in 'block in HTTPX::Connection::HTTP2#handle'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/connection/http2.rb:169:in 'Kernel#catch'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/connection/http2.rb:169:in 'HTTPX::Connection::HTTP2#handle'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/connection/http2.rb:118:in 'HTTPX::Connection::HTTP2#send'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/connection/http2.rb:164:in 'HTTPX::Connection::HTTP2#send_pending'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/connection/http2.rb:357:in 'HTTPX::Connection::HTTP2#on_settings'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/emitter.rb:36:in 'block in HTTP2::Emitter#emit'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/emitter.rb:35:in 'Array#delete_if'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/emitter.rb:35:in 'HTTP2::Emitter#emit'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/connection.rb:678:in 'HTTP2::Connection#connection_settings'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/connection.rb:495:in 'HTTP2::Connection#connection_management'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/connection.rb:275:in 'HTTP2::Connection#receive'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/client.rb:46:in 'HTTP2::Client#receive'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/http-2-1.1.0/lib/http/2/connection.rb:424:in 'HTTP2::Connection#<<'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/connection/http2.rb:98:in 'HTTPX::Connection::HTTP2#<<'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/connection.rb:442:in 'block (3 levels) in HTTPX::Connection#consume'
	from <internal:kernel>:168:in 'Kernel#loop'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/connection.rb:423:in 'block (2 levels) in HTTPX::Connection#consume'
	from <internal:kernel>:168:in 'Kernel#loop'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/connection.rb:392:in 'block in HTTPX::Connection#consume'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/connection.rb:390:in 'Kernel#catch'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/connection.rb:390:in 'HTTPX::Connection#consume'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/connection.rb:250:in 'HTTPX::Connection#call'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/selector.rb:185:in 'HTTPX::Selector#select_one'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/selector.rb:122:in 'HTTPX::Selector#select'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/selector.rb:38:in 'block in HTTPX::Selector#next_tick'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/selector.rb:30:in 'Kernel#catch'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/selector.rb:30:in 'HTTPX::Selector#next_tick'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/session.rb:313:in 'block (2 levels) in HTTPX::Session#receive_requests'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/session.rb:313:in 'Kernel#catch'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/session.rb:313:in 'block in HTTPX::Session#receive_requests'
	from <internal:kernel>:168:in 'Kernel#loop'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/session.rb:308:in 'HTTPX::Session#receive_requests'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/session.rb:283:in 'HTTPX::Session#send_requests'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/session.rb:106:in 'HTTPX::Session#request'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/httpx-1.4.4/lib/httpx/chainable.rb:10:in 'HTTPX::Chainable#post'
	from (minum-web):17:in '<main>'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/irb-1.15.2/lib/irb/workspace.rb:101:in 'Kernel#eval'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/irb-1.15.2/lib/irb/workspace.rb:101:in 'IRB::WorkSpace#evaluate'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/irb-1.15.2/lib/irb/context.rb:591:in 'IRB::Context#evaluate_expression'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/irb-1.15.2/lib/irb/context.rb:557:in 'IRB::Context#evaluate'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/irb-1.15.2/lib/irb.rb:201:in 'block (2 levels) in IRB::Irb#eval_input'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/irb-1.15.2/lib/irb.rb:512:in 'IRB::Irb#signal_status'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/irb-1.15.2/lib/irb.rb:193:in 'block in IRB::Irb#eval_input'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/irb-1.15.2/lib/irb.rb:272:in 'block in IRB::Irb#each_top_level_statement'
	from <internal:kernel>:168:in 'Kernel#loop'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/irb-1.15.2/lib/irb.rb:269:in 'IRB::Irb#each_top_level_statement'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/irb-1.15.2/lib/irb.rb:192:in 'IRB::Irb#eval_input'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/irb-1.15.2/lib/irb.rb:173:in 'block in IRB::Irb#run'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/irb-1.15.2/lib/irb.rb:172:in 'Kernel#catch'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/irb-1.15.2/lib/irb.rb:172:in 'IRB::Irb#run'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/railties-8.0.2/lib/rails/commands/console/irb_console.rb:112:in 'Rails::Console::IRBConsole#start'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/railties-8.0.2/lib/rails/commands/console/console_command.rb:59:in 'Rails::Console#start'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/railties-8.0.2/lib/rails/commands/console/console_command.rb:8:in 'Rails::Console.start'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/railties-8.0.2/lib/rails/commands/console/console_command.rb:87:in 'Rails::Command::ConsoleCommand#perform'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/thor-1.3.2/lib/thor/command.rb:28:in 'Thor::Command#run'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/thor-1.3.2/lib/thor/invocation.rb:127:in 'Thor::Invocation#invoke_command'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/railties-8.0.2/lib/rails/command/base.rb:178:in 'Rails::Command::Base#invoke_command'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/thor-1.3.2/lib/thor.rb:538:in 'Thor.dispatch'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/railties-8.0.2/lib/rails/command/base.rb:73:in 'Rails::Command::Base.perform'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/railties-8.0.2/lib/rails/command.rb:65:in 'block in Rails::Command.invoke'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/railties-8.0.2/lib/rails/command.rb:143:in 'Rails::Command.with_argv'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/railties-8.0.2/lib/rails/command.rb:63:in 'Rails::Command.invoke'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/railties-8.0.2/lib/rails/commands.rb:18:in '<main>'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require'
	from /Users/leo/.asdf/installs/ruby/3.4.2/lib/ruby/gems/3.4.0/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in 'Kernel#require'
	from bin/rails:6:in '<main>'

(pid:23543 tid:2632, self:HTTPX::SSL#41648) WRITE: 223 bytes...
(pid:23543 tid:2632, self:HTTPX::SSL#41648) 18.64.207.74 negotiated -> closed
(pid:23543 tid:2632, self:HTTPX::Connection#41656) emit :close callbacks

For now fixed by adding ssl: { alpn_protocols: %w[http/1.1] } in HTTPX.with.

Also, based on trace it may be issue not with your gem, but http-2, but decided notify you

BTW, data = {description: "7022025 descrição".force_encoding(Encoding::UTF_8)} and data = {description: "7022025 descrição".force_encoding(Encoding::BINARY)} does not help with issue

Edited by Alexey Vasilyev