GithubHelp home page GithubHelp logo

Comments (11)

cpriego avatar cpriego commented on July 30, 2024

It looks like a problem in either your routes file or client side not using the right method.
Could you post a sample of the client request and route file section?

Are you using the api.php or web.php file?

from valet-linux.

luisfmelo avatar luisfmelo commented on July 30, 2024

in routes/api.php

Route::post('/test', function(){
    return "everything seems fine";
});

trying to access integrations.dev/api/test

and I receive:
MethodNotAllowedHttpException in RouteCollection.php line 233:

from valet-linux.

cpriego avatar cpriego commented on July 30, 2024

How are you testing the endpoint? I just tried your example with postman but could not reproduce it. I can only see that exact error when using the wrong HTTP verb.

selection_005

selection_003

selection_004

from valet-linux.

cpriego avatar cpriego commented on July 30, 2024

Please update to the latest version.

from valet-linux.

luisfmelo avatar luisfmelo commented on July 30, 2024

I updated but now nginx is not starting:

$ valet status
Php7.0-fpm is running...
Nginx is stopped...

from valet-linux.

luisfmelo avatar luisfmelo commented on July 30, 2024

Ok, it appears that /etc/nginx/nginx.conf had one semi colon thet it should not be there.

But, POST requests are still not working.

from valet-linux.

cpriego avatar cpriego commented on July 30, 2024

Thanks for pointing out the double semicolon, it is now fixed. Does the problem show up in Laravel Homestead?

from valet-linux.

luisfmelo avatar luisfmelo commented on July 30, 2024

I don't use homestead...

But the issue with POST, it is something in valet or within my application?

from valet-linux.

cpriego avatar cpriego commented on July 30, 2024

I'm almost sure it is with the application, that's the reason I asked you to test it in Homestead. I don't know the tool you used to test the API but as you can see in my screenshots it works just fine in my Valet installation.

from valet-linux.

cristianofromagio avatar cristianofromagio commented on July 30, 2024

MethodNotAllowedHttpException indicates that a route doesn't exist for the HTTP method you are requesting. If you have a POST route set up, you can't access it directly from the browser, since it performs a GET request. If you can't reproduce the test as shown by @cpriego, you can simply set up a form on a GET route forwarding to the POST route using the action method (remember to include {{ csrf_field() }} inside form tag, more info here).

from valet-linux.

cpriego avatar cpriego commented on July 30, 2024

Closed by inactivity

from valet-linux.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.