Method delete is not supported
See original GitHub issueVersions:
@inertiajs/inertia
version: 6.14.11@inertiajs/inertia-react
version: 6.14.11
Describe the problem:
When I use Inertia.delete on react, data is deleted as expected, but shows an error that says DELETE method is not supported. supported methods: GET, HEAD, POST
I have to reload the page to see the changes (I guess it is because of the redirect to a route that uses get method
Steps to reproduce:
create Route::resource
routes like this
Auth::routes(); Route::resource('users', 'App\Http\Controllers\Backend\PostController')->middleware('auth');
create destroy method
use App\Models\Post; class UserController extends Controller { public function destroy(User $user){ $user->delete(); $return back(); } }
in any React component in a route that uses get, head or post method do this:
Inertia.delete('/users/', user.id)
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Spring - 405 Http method DELETE is not supported by this URL
The controller is mapped using @RequestMapping("/authorization_servers"); When I send a request through my DEV Http Client, I am getting the ...
Read more >The DELETE method is not supported spring boot
Request method 'GET' not supported. Here's the code : RequestMapping(value="/empdelete/{id}", method=RequestMethod.DELETE)
Read more >The DELETE method is not supported for this route - Laracasts
I get this error whenever I hit the delete button to delete a thread. Copy Code The DELETE method is not supported for...
Read more >The DELETE method is not supported for this route In Laravel ...
The DELETE method is not supported for this route In Laravel 8 Solution. 1.1K views 1 year ago MATHURA · Programming Experience.
Read more >The POST method is not supported for this route ... - Medium
When i click on delete button its showing the Post method is not supported for this route supported method delete. Let's go to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@AndrGutierrez The signature of the the
delete
method isCan you please try the following change:
I am also facing same issue. How we can fix it with ziggy route?