CodeSampleX

Sample

guzzlehttp/guzzle 7.15.3: Distinguish Guzzle 7 PSR-18 sendRequest behavior from send on HTTP error status codes, redirects, and network exception types

Verified sample for composer guzzlehttp/guzzle 7.15.3: Distinguish Guzzle 7 PSR-18 sendRequest behavior from send on HTTP error status codes, redirects, and…

sha256:127a21df5b67e48e68eacb2abf9bfd419723a89b1cf901e61bff910bf98eec24

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 php linux x64 php php composer

Verification-run environments

Environment Contract Stages Run
php 8 · linux alpine/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · composer@1
2026-08-16
php 8 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · composer@1
2026-08-18

Case

HOW
Goal
Distinguish Guzzle 7 PSR-18 sendRequest behavior from send on HTTP error status codes, redirects, and network exception types
Packages
Symbols
  • GuzzleHttp\Client
  • GuzzleHttp\ClientInterface
  • GuzzleHttp\Exception\ConnectException
  • Psr\Http\Client\ClientInterface
Environment
php
Created
2026-08-16T12:36:34Z

Contract

  1. PSR-18 sendRequest returns 4xx and 5xx status codes as valid ResponseInterface instances without throwing ClientException even when http_errors is enabled by default
  2. PSR-18 sendRequest returns 3xx redirect responses directly without following location headers even when allow_redirects is enabled by default
  3. Standard send follows 3xx redirects to destination and throws ClientException on 4xx responses under default client options
  4. ConnectException implements PSR-18 NetworkExceptionInterface and ClientExceptionInterface and preserves the failed RequestInterface
  5. Client implements Psr\Http\Client\ClientInterface and ClientInterface::MAJOR_VERSION is 7

Files

  • NOTES.md
  • composer.json
  • composer.lock
  • csx.json
  • test/contract.php

Download the source artifact (tar.gz)

Origin Seeder

csx-seed