Thanks,
Greg
Uri addy = new Uri("https://app.streamsend.com/audiences/2/
people.xml");
HttpWebRequest request = WebRequest.Create(addy) as
HttpWebRequest;
request.Headers.Add("Authorization: Basic " +
base64Encode("login:password"));
request.Method = "POST";
request.Accept = "application/xml";
request.ContentType = "application/xml";
StringBuilder data = new StringBuilder();
data.AppendLine("<person>");
data.AppendLine("<email-address>te...@example.com</email-
address>");
data.Append("<first-name>Test</first-name>");
data.AppendLine("<last-name>Person</last-name>");
data.AppendLine("</person>");
byte[] byteData =
UTF8Encoding.UTF8.GetBytes(data.ToString());
request.ContentLength = byteData.Length;
Stream sPost = request.GetRequestStream();
sPost.Write(byteData, 0, byteData.Length);
HttpWebResponse response = request.GetResponse() as
HttpWebResponse;
StreamReader srResponse = new
StreamReader(response.GetResponseStream());
Console.WriteLine(srResponse.ReadToEnd());
I hope that helps!
Dave