What is the use HTTP hook in Inertia v3 and how does it replace Axios for certain requests?

Answered by 3 creators across 3 videos

Inertia v3 introduces a built‑in useHTTP client that handles JSON requests directly through Inertia, so you don’t need Axios for many data-fetching or action-request scenarios. As Pascal Baljet notes, Inertia swapped Axios for a custom HTTP implementation and the new useHTTP makes requests work “without a navigation” and with JSON responses, while still allowing you to opt into Axios if you really want to. Nunomaduro highlights that this hook enables you to perform JSON-enabled requests via Inertia, effectively replacing the Axios dependency for many common use cases. Laravel Daily reinforces the shift by stating that Axios is removed from the ecosystem and the built‑in HTTP client handles requests, simplifying code and reducing dependencies. Taken together, the useHTTP hook provides a first‑class, built‑in way to perform API calls and page updates, improving checkout‑free data flows and replacing Axios for a broad set of requests, especially those that return JSON without needing a full navigation.

  • Pascal Baljet points out that Inertia v3 replaces Axios with a built‑in HTTP implementation and that the useHTTP client can deliver JSON responses without requiring a navigation.
  • Laravel Deep/Daily notes emphasize that Inertia no longer ships with Axios and that the built‑in HTTP client handles HTTP requests, reducing external dependencies.
  • Nunomaduro highlights that useHTTP enables JSON-enabled requests directly via Inertia, effectively substituting Axios in many scenarios.
  • Laravel Daily adds that the new HTTP approach makes code shorter and removes Axios from the ecosystem for data queries or actions.
  • Overall, as described across the videos, the useHTTP hook is a native Inertia utility designed to streamline requests, particularly JSON responses, without relying on Axios for most use cases.