405 error with Strapi

Hello, I need help. I just started out with the Strapi node and I’m getting a 405 error. I’m utilizing the GetAll request and I don’t know what I’m doing wrong

Hey @hannydevelop!

Thank you for opening the topic. Did you follow all the steps mentioned here: Strapi | Docs

Did you also gave the required permissions from Strapi?

yes, I gave the required permissions and followed the steps. However in URL of your Strapi instance, I put in http://localhost:1337/blogs as this is the URL to my collection type. I also used http://localhost:1337/admin when I got the 405 error. But I still got the error

Did you try with https://localhost:1337? You don’t have to specify the exact endpoint in the credentials.

I think that should be the problem, I now get a different error: 400 - {"statusCode":400,"error":"Bad Request","message":[{"messages":[{"id":"Auth.form.error.invalid","message":"Identifier or password invalid."}]}],"data":[{"messages":[{"id":"Auth.form.error.invalid","message":"Identifier or password invalid."}]}]}:

Hey! My apologies, it should be http://localhost:1337 and not https. This should solve your issue :slight_smile:

I figured, so I now get a different error: 400 - {"statusCode":400,"error":"Bad Request","message":[{"messages":[{"id":"Auth.form.error.invalid","message":"Identifier or password invalid."}]}],"data":[{"messages":[{"id":"Auth.form.error.invalid","message":"Identifier or password invalid."}]}]}:

As the message says, the username or password is not correct. You will have to check them. Also, make sure that this user has the access to the API endpoint.

I’m certain my password is correct and that I followed the instructions carefully so I’ll switch to Ubuntu and hopefully that helps

I just tried this out on Ubuntu and it works fine.

Error: Request failed with status code 405
    at createError (/root/.npm/_npx/a8a7eec953f1f314/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/root/.npm/_npx/a8a7eec953f1f314/node_modules/axios/lib/core/settle.js:17:12)
    at IncomingMessage.handleStreamEnd (/root/.npm/_npx/a8a7eec953f1f314/node_modules/axios/lib/adapters/http.js:269:11)
    at IncomingMessage.emit (events.js:412:35)
    at endReadableNT (internal/streams/readable.js:1334:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)

maybe you help me ?