Recent Topics

API not working properly in my site



  • Hello,

    I tried my api on producation web site but the data is not displayed I am receiving the bad request message, how can I solve the problem because the same api are working in localhost.

    I get this error

    <html>

    <head>
    <title>400 Bad Request</title>
    </head>

    <body>
    <h1>Bad Request</h1>
    <p>Your browser sent a request that this server could not understand.<br />
    </p>
    <hr>
    <address>Apache/2.4.41 (Ubuntu) Server at sitename Port 443</address>
    </body>

    </html>

    Thanks & Regards



  • Hi @xudaqacomo,

    Please share the full-body request and header so that I can debug this.



  • Dear Devnash,

    You can find in attachment the body request in the headers I do not send anything as a parameter as the get method is being used.

    If you have a lot of information please send me the email address I will write to you, for security reasons I can not open the name of the website.

    Thank you!Screenshot_1.png



  • Dear support I forgot to tell you this api is working in my localhost machine but is not working only my server.

    Thank you!



  • Hi @xudaqacomo,

    Just go to .env file and update the APP_URL key.

    Then go to terminal and run this command (this is important),
    php artisan optimize



  • Dear support,

    My project is in version 5.6 of laravel and in this version php artisan optimize is removed this command. Do you have any suggestion how to optimize when update my APP_URL.

    Thank you!



  • Hi @xudaqacomo,

    php artisan config:cache.

    Important Note: We won't provide support for Laravel Version 5.



  • Dear Support,

    I tried based on the steps you said but it still does not work, it's you get the error above what I sent.

    Thank you!



  • No, I am not getting this error. All you need to do is just check the below point,

    • First, check the .env APP_URL. Make sure the URL you provided is right.
    • Also check the ports HTTP/HTTPS.
    • Check whether your changes have been updated or not.
    • Just try with debug mode on. So that you can see the error also.

Log in to reply