laravel:http-client-resilience

Enforce timeouts, retries, and contextual logging for outbound HTTP calls.

Updated Mar 30, 2026
One-click install
npx skills add https://github.com/Patkik/Multi-tenant-SaaS-Catering-V2 --skill laravel-http-client-resilience-patkik
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel:http-client-resilience
Source: https://github.com/Patkik/Multi-tenant-SaaS-Catering-V2/tree/main/.agents/skills/http-client-resilience
Command: npx skills add https://github.com/Patkik/Multi-tenant-SaaS-Catering-V2 --skill laravel-http-client-resilience-patkik

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Reduces flaky outbound HTTP calls by enforcing timeouts, retries, and contextual logging.

Core Features & Use Cases

  • Explicit timeouts for outbound requests to prevent hanging calls and improve SLA
  • Limited retries with backoff for transient failures, with optional throw/continue semantics
  • Dependency injection-friendly for testability and mocking
  • Redacted, context-rich logging of requests and responses to improve observability
  • Concurrency support via pool() when calling multiple endpoints

Quick Start

Configure your HTTP client with a base URL, timeout, and retry policy, then log and handle non-successful responses.

Frequently Asked Questions about laravel:http-client-resilience

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle timeouts and retries for flaky outbound HTTP calls in Laravel?

To handle flaky outbound HTTP calls, enforce explicit timeouts and apply limited retries with backoff. This approach prevents hanging requests and recovers from transient failures, ensuring predictable timing and improved SLA compliance for external API integrations.

How do I log redacted request and response context when retrying HTTP client calls?

Logging redacted request and response context during HTTP retries requires context-rich logging that obscures sensitive data. This improves observability across retry attempts without exposing confidential payload information, satisfying secure tracing requirements.

Can I use dependency injection to mock the Laravel HTTP client for resilience testing?

Dependency injection is supported to mock the HTTP client for resilience testing. This design allows you to simulate transient failures, verify retry behavior, and validate timeout enforcement in a controlled test environment.

What is the best way to configure backoff-based retries for transient API failures?

The best way to configure backoff-based retries for transient API failures is to define a limited retry policy with increasing delays between attempts. This mitigates temporary endpoint issues while preventing indefinite blocking.

Does concurrent HTTP client support work with retry policies when calling multiple endpoints?

Concurrent HTTP client support works with retry policies by utilizing pool() to call multiple endpoints simultaneously. This maintains resilience policies like timeouts and backoff across parallel requests to various external APIs.

Why do outbound API calls hang and how can I prevent it without losing requests?

Outbound API calls hang due to unresponsive external endpoints, which you can prevent by enforcing explicit timeouts. Applying limited retries with backoff ensures the client recovers from transient delays without dropping the request entirely.