Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var username = "ant1";
- var password = "2015";
- var url = 'https://test.ru/ajax.php';
- $.ajax({
- type: "PROPFIND",
- url: url,
- success: function(json) {
- alert("Success", json);
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- alert(textStatus, errorThrown);
- console.log(XMLHttpRequest);
- },
- beforeSend: function (xhr) {
- xhr.withCredentials = true;
- xhr.setRequestHeader ("withCredentials", "true");
- xhr.setRequestHeader ("Authorization", "Basic " + btoa(username + ":" + password));
- }
- });
- var_dump($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']);
- RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
- curl --user username:password https://test.ru/ajax.php
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement