1

当我这样调用服务器时:

       var client = new RestClient();
       client.Authenticator =  new NtlmAuthenticator();

       var request = new RestRequest(uri); 
       request.Method = Method.POST;
       request.RequestFormat = DataFormat.Xml;

       request.AddParameter("application/atom+xml", doc /*some xml document*/, ParameterType.RequestBody);
       IRestResponse response = client.Execute(request);

       Debug.WriteLine(response.Content); 

       if(response.StatusCode == HttpStatusCode.Created)
        {
          // always 401
        }

我得到下一个服务器响应:

<?xml version="1.0" encoding="UTF-8"?>
<SmoothStreaming xmlns="http://schemas.microsoft.com/iis/media/2011/03/streaming/management">
    <Error>
         <ErrorCode>0x80880022</ErrorCode>
         <ErrorMessage>All requests to the management APIs must be authenticated. Please install and enable an appropriate IIS authentication module for this website.</ErrorMessage>
    </Error>
</SmoothStreaming>

我应该在哪里更改(安装)?

4

0 回答 0