testing different rest post method/class for Grid asset client. (possible that I haven't set the post url correctly)

This commit is contained in:
MW
2007-11-03 14:04:59 +00:00
parent f8e0cf0f1d
commit 91c2c3c096
2 changed files with 60 additions and 9 deletions

View File

@@ -32,6 +32,7 @@ using System.IO;
using System.Xml.Serialization;
using libsecondlife;
using OpenSim.Framework.Console;
using OpenSim.Framework.Servers;
namespace OpenSim.Framework.Communications.Cache
{
@@ -103,16 +104,17 @@ namespace OpenSim.Framework.Communications.Cache
{
try
{
MemoryStream s = new MemoryStream();
// MemoryStream s = new MemoryStream();
XmlSerializer xs = new XmlSerializer(typeof (AssetBase));
xs.Serialize(s, asset);
RestClient rc = new RestClient(_assetServerUrl);
MainLog.Instance.Verbose("ASSET", "Storing {0}", rc);
rc.AddResourcePath("assets");
rc.RequestMethod = "POST";
rc.Request(s);
MainLog.Instance.Verbose("ASSET", "Stored {0}", rc);
// XmlSerializer xs = new XmlSerializer(typeof(AssetBase));
// xs.Serialize(s, asset);
// RestClient rc = new RestClient(_assetServerUrl);
MainLog.Instance.Verbose("ASSET", "Storing asset");
//rc.AddResourcePath("assets");
// rc.RequestMethod = "POST";
// rc.Request(s);
//MainLog.Instance.Verbose("ASSET", "Stored {0}", rc);
RestObjectPoster.BeginPostObject<AssetBase>(_assetRequests + "/assets/", asset);
}
catch (Exception e)
{