Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    API not working properly in my site

    General Discussion
    2
    9
    638
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • X
      xudaqacomo last edited by

      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

      1 Reply Last reply Reply Quote 0
      • devansh-webkul
        devansh-webkul last edited by

        Hi @xudaqacomo,

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

        1 Reply Last reply Reply Quote 0
        • X
          xudaqacomo last edited by

          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

          1 Reply Last reply Reply Quote 0
          • X
            xudaqacomo last edited by

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

            Thank you!

            1 Reply Last reply Reply Quote 0
            • devansh-webkul
              devansh-webkul last edited by

              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

              1 Reply Last reply Reply Quote 0
              • X
                xudaqacomo last edited by

                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!

                1 Reply Last reply Reply Quote 0
                • devansh-webkul
                  devansh-webkul last edited by

                  Hi @xudaqacomo,

                  php artisan config:cache.

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

                  1 Reply Last reply Reply Quote 0
                  • X
                    xudaqacomo last edited by

                    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!

                    1 Reply Last reply Reply Quote 0
                    • devansh-webkul
                      devansh-webkul last edited by

                      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.
                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post