Answer the question
In order to leave comments, you need to log in
How to make native basic http authorization?
Hello.
I make an HTTP-GET request, here it is (only the host is different):
'GET /cgi-bin/auth.cgi HTTP/1.1
Authorization: Basic cm9vdDpyb290
Host: example.ru
Accept: */*
Connection: close
Accept-Encoding: gzip, deflate
Authorization: "Basic "+base64_encode("root:root")
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>401 - Unauthorized</title>
</head>
<body>
<h1>401 - Unauthorized</h1>
</body>
</html>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question