Inertia request not quite like an ajax request.
When you make inertia request it expect a page response. Like when you submit a form, if success your need to return redirect back or redirect to another page.
So, If you use inertia and want to fetch data via an api you should use something else ie axios or the fetch api.
In my opinion, inertia post request more like traditional form submit than an ajax request posting data to the backend.