-1

I'm seeing really weird behavior. I've created a custom REST resource at the route /user/login-special.

This is a passwordless login resource, so I pass the mail address and then get a response that says Login email was sent!

However, when I POST to the https://abc-xyz-123.us-3.platformsh.site/user/login-special?_format=json, I get the error:

{
    "message": "No route found for \"GET https://www.abc-xyz-123.us-3.platformsh.site/user/login-special?_format=json\" (from \"https://abc-xyz-123.us-3.platformsh.site/user/login-special?_format=json\")"
}

The route definitely exists... what is going on? And why is it saying GET when I used POST?

1 Answer 1

1

Read the error carefully.

You POSTed to https://abc-xyz-123.us-3.platformsh.site/user/login-special?_format=json, but it is returning https://www-- you're getting redirected.

So the solution is to POST to https://www.abc-xyz-123.us-3.platformsh.site/user/login-special?_format=json and everything works as expected.

This might be obvious to most people, but I wasted a lot of time debugging this today, so I'm posting it here in case anyone else makes the same mistake in the future.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.