Запрещен на ajax звонок в SMP Регистрация - PullRequest
0 голосов
/ 11 июля 2019

Я сталкиваюсь с этой ошибкой, пытаясь зарегистрировать пользователя в SMP.403 Запрещено

Пожалуйста, помогите мне исправить это.

 var person={user:"",password:""};

    $.ajax({  url: 'http://*****/***/applications/***/******/Connections',
        type: 'post', 
        contentType:application/xml',
         headers: {
          'Content-Type':'application/xml', 
         'contentType': 'application/xml',
            'Authorization': 'Basic '+btoa(person.user + ':' + person.password)
                },
                 data:'<?xml version="1.0" encoding="UTF-8"?><entry xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> <content type="application/xml"> <m:properties>  <d:DeviceType>iPhone</d:DeviceType>  </m:properties>   </content></entry>',
          success: function (response, status, xhr) {
          alert(status);
        },
        error: function ( xhr, ajaxOptions, thrownError) {
        console.log(xhr)
        console.log(thrownError)
        alert("Local error callback.");
      },
    });
...