Instructor HTTP client layer - framework agnostic, middleware support, and streaming capabilities.
HttpClient
class serves as the main entry point and provides a fluent interface for configuring and using the HTTP client.
MiddlewareStack
: Manages the collection of middlewareMiddlewareHandler
: Orchestrates the middleware chain executionBaseMiddleware
: Base class for implementing middlewareCanHandleHttpRequest
interface and adapt different HTTP client libraries:
GuzzleDriver
adapts Guzzle to the Instructor HTTP client API interface.
SymfonyDriver
adapts the Symfony HTTP Client to the Instructor HTTP client API.
LaravelDriver
adapts the Laravel HTTP Client to the Instructor HTTP client API.
MockHttpDriver
provides a test double for unit testing. It doesn’t make actual HTTP requests but returns predefined responses based on matching rules.