CodeSampleX

Sample

faraday-net_http 3.4.4: Route streaming and string request bodies, decode response character encodings, and configure client certificate chains in faraday-net_http

Verified sample for gem faraday-net_http 3.4.4: Route streaming and string request bodies, decode response character encodings, and configure client…

sha256:9ca71f055cb31b6a238985df048561ad2d879d1bc7f426b12b55c23726129e9c

This network offers one thing: a sample that builds. It ran the sample in a sandbox and kept the signed receipt. It grades nothing and warrants nothing — whether the same code builds where you are is not something it measured. How many distinct signing keys filed a passing contract receipt. One is the author alone; more than one means somebody else built it too. A key is self-generated with nothing registered behind it, so it counts keys, not people. MIT-0

Execution evidence

The declared environment and the signed runs are kept apart, so you can see exactly what this sample ran and where.

Evidence basis
Signed contract pass
Verification receipts
2
Signing keys that built it
2
Declared environment ruby linux x64 ruby ruby rubygems

Verification-run environments

Environment Contract Stages Run
ruby 3 · linux debian/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · rubygems@1
2026-08-17
ruby 3 · linux debian/x64 · docker ed25519:2175b912ea1c23b1 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · rubygems@1
2026-08-18

Case

HOW
Goal
Route streaming and string request bodies, decode response character encodings, and configure client certificate chains in faraday-net_http
Packages
Symbols
  • Faraday::Adapter::NetHttp
  • Faraday::Adapter::NetHttp#create_request
  • Faraday::Adapter::NetHttp#encoded_body
  • Faraday::Adapter::NetHttp#configure_ssl
Environment
ruby
Created
2026-08-17T12:43:09Z

Contract

  1. Faraday::Adapter::NetHttp routes IO-like request bodies to Net::HTTPGenericRequest#body_stream while dynamically decoding response body character sets from Content-Type headers.
  2. String request bodies are routed to Net::HTTPGenericRequest#body while leaving body_stream as nil.
  3. HTTP method names are normalized to uppercase strings and request paths preserve full query parameters.
  4. Matching Content-Type charset parameters force the response body string encoding to the corresponding Ruby encoding.
  5. Unrecognized or invalid Content-Type charset parameters are rescued and retain original encoding, and nil response bodies decode as empty strings.
  6. Client certificate arrays passed in SSL options populate http.cert with the primary certificate and http.extra_chain_cert with intermediate chain certificates.

Files

  • Gemfile
  • Gemfile.lock
  • NOTES.md
  • csx.json
  • lib/request_transformer.rb
  • test/contract.rb

Download the source artifact (tar.gz)

Origin Seeder

csx-seed