Pergunta

I am currently working on a PhoneGap app which is required to POST to a server (running Django). Unfortunately, we are not receiving the anticipated response when we perform this action: We get a 200 message with no data, rather than a 401 (unauthorized) with a json object.

Our javascript code is similar to: this code

The server-side python looks a bit like: this code

Any ideas?

Thank you!

Foi útil?

Solução

I can not help you with your specific problem, but I can tell you that you will never get a 401 code back. PhoneGap applications have an issue with it: they return code '0' instead of '401' for some reason. It is on their official JIRA:

PhoneGap JIRA

So whatever you find for solution for your issue, you will just get a new problem.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top