aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/WebUtil.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/WebUtil.cs')
-rw-r--r--OpenSim/Framework/WebUtil.cs24
1 files changed, 11 insertions, 13 deletions
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs
index 147a011..be7504f 100644
--- a/OpenSim/Framework/WebUtil.cs
+++ b/OpenSim/Framework/WebUtil.cs
@@ -907,15 +907,6 @@ namespace OpenSim.Framework
907 } 907 }
908 } 908 }
909 909
910 public class SynchronousRestObjectPoster
911 {
912 [Obsolete]
913 public static TResponse BeginPostObject<TRequest, TResponse>(string verb, string requestUrl, TRequest obj)
914 {
915 return SynchronousRestObjectRequester.MakeRequest<TRequest, TResponse>(verb, requestUrl, obj);
916 }
917 }
918
919 public class SynchronousRestObjectRequester 910 public class SynchronousRestObjectRequester
920 { 911 {
921 private static readonly ILog m_log = 912 private static readonly ILog m_log =
@@ -981,9 +972,6 @@ namespace OpenSim.Framework
981 { 972 {
982 using (HttpWebResponse resp = (HttpWebResponse)request.GetResponse()) 973 using (HttpWebResponse resp = (HttpWebResponse)request.GetResponse())
983 { 974 {
984 if (resp.StatusCode == HttpStatusCode.NotFound)
985 return deserial;
986
987 if (resp.ContentLength != 0) 975 if (resp.ContentLength != 0)
988 { 976 {
989 Stream respStream = resp.GetResponseStream(); 977 Stream respStream = resp.GetResponseStream();
@@ -993,9 +981,19 @@ namespace OpenSim.Framework
993 } 981 }
994 else 982 else
995 m_log.DebugFormat("[SynchronousRestObjectRequester]: Oops! no content found in response stream from {0} {1}", requestUrl, verb); 983 m_log.DebugFormat("[SynchronousRestObjectRequester]: Oops! no content found in response stream from {0} {1}", requestUrl, verb);
996
997 } 984 }
998 } 985 }
986 catch (WebException e)
987 {
988 HttpWebResponse hwr = (HttpWebResponse)e.Response;
989
990 if (hwr != null && hwr.StatusCode == HttpStatusCode.NotFound)
991 return deserial;
992 else
993 m_log.ErrorFormat(
994 "[SynchronousRestObjectRequester]: WebException {0} {1} {2} {3}",
995 requestUrl, typeof(TResponse).ToString(), e.Message, e.StackTrace);
996 }
999 catch (System.InvalidOperationException) 997 catch (System.InvalidOperationException)
1000 { 998 {
1001 // This is what happens when there is invalid XML 999 // This is what happens when there is invalid XML