1

Sorry, i speak English a little bit. I have a js code

url = '/auth'
var http_request = window.XDomainRequest || window.XMLHttpRequest;
http_request = new http_request;
http_request.open( "post", url, true, 'jack', 'pass_jack' );
http_request.send();

And python BaseHTTPServer

def do_POST(self):
    if self.path == '/auth':

How i can check username and password in python?

1 Answer 1

1

XMLHttpRequest sets the Authentication header, you'd need parse that header:

auth = self.headers['Authentication']

See RFC 2617 (HTTP Authentication: Basic and Digest Access Authentication) for details on how a user agent interacts with a server through that header.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.