aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Servers/RestStreamHandler.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Servers/RestStreamHandler.cs')
-rw-r--r--OpenSim/Framework/Servers/RestStreamHandler.cs62
1 files changed, 31 insertions, 31 deletions
diff --git a/OpenSim/Framework/Servers/RestStreamHandler.cs b/OpenSim/Framework/Servers/RestStreamHandler.cs
index 1b3b41c..6753a06 100644
--- a/OpenSim/Framework/Servers/RestStreamHandler.cs
+++ b/OpenSim/Framework/Servers/RestStreamHandler.cs
@@ -1,31 +1,31 @@
1using System; 1using System;
2using System.Collections.Generic; 2using System.Collections.Generic;
3using System.Text; 3using System.Text;
4using System.IO; 4using System.IO;
5 5
6namespace OpenSim.Framework.Servers 6namespace OpenSim.Framework.Servers
7{ 7{
8 public class RestStreamHandler : BaseStreamHandler 8 public class RestStreamHandler : BaseStreamHandler
9 { 9 {
10 RestMethod m_restMethod; 10 RestMethod m_restMethod;
11 11
12 override public byte[] Handle(string path, Stream request ) 12 override public byte[] Handle(string path, Stream request )
13 { 13 {
14 Encoding encoding = Encoding.UTF8; 14 Encoding encoding = Encoding.UTF8;
15 StreamReader streamReader = new StreamReader(request, encoding); 15 StreamReader streamReader = new StreamReader(request, encoding);
16 16
17 string requestBody = streamReader.ReadToEnd(); 17 string requestBody = streamReader.ReadToEnd();
18 streamReader.Close(); 18 streamReader.Close();
19 19
20 string param = GetParam(path); 20 string param = GetParam(path);
21 string responseString = m_restMethod(requestBody, path, param ); 21 string responseString = m_restMethod(requestBody, path, param );
22 22
23 return Encoding.UTF8.GetBytes(responseString); 23 return Encoding.UTF8.GetBytes(responseString);
24 } 24 }
25 25
26 public RestStreamHandler(string httpMethod, string path, RestMethod restMethod) : base( httpMethod, path ) 26 public RestStreamHandler(string httpMethod, string path, RestMethod restMethod) : base( httpMethod, path )
27 { 27 {
28 m_restMethod = restMethod; 28 m_restMethod = restMethod;
29 } 29 }
30 } 30 }
31} 31}