Adding a body to a HttpWebRequest that is being used with the azure service mgmt api
问题 How would i go about adding to the body of a HttpWebRequest? The body needs to be made up of the following <?xml version="1.0" encoding="utf-8"?> <ChangeConfiguration xmlns="http://schemas.microsoft.com/windowsazure"> <Configuration>base-64-encoded-configuration-file</Configuration> <TreatWarningsAsError>true|false</TreatWarningsAsError> <Mode>Auto|Manual</Mode> </ChangeConfiguration> Any help is much appreciated 回答1: byte[] buf = Encoding.UTF8.GetBytes(xml); request.Method = "POST"; request