Thanks to Gusman's help, I've managed to figure it out!
I've changed my C# code to the following:
HttpWebRequest request = WebRequest.CreateHttp("http://127.0.0.1:3000/products/32.xml");
request.Method = "GET";
request.ContentType = "application/xml";
WebResponse response = request.GetResponse();
String text;
using (StreamReader reader = new StreamReader(response.GetResponseStream()))
{
text = reader.ReadToEnd();
}
I added the ".xml" extension to the URL in the CreateHttp method. This way, the regular HTML page will not be loaded; only the XML page will be loaded. As a result of doing this, I had to handle the different format in Rails. Here's what the end of my "show" action in the Products controller looks like:
respond_to do |format|
format.html
format.xml { render :xml => @product }
end
This allows the handling of XML GET requests. I have yet to work on the POST part, but I'm assuming it wouldn't be too different.
Thanks again for all of the help!