diff options
Diffstat (limited to 'OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs')
-rw-r--r-- | OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs index 6e32362..c670ad7 100644 --- a/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs +++ b/OpenSim/Region/Environment/Modules/Scripting/HttpRequest/ScriptsHttpRequests.cs | |||
@@ -37,6 +37,7 @@ using OpenSim.Framework; | |||
37 | using OpenSim.Framework.Servers; | 37 | using OpenSim.Framework.Servers; |
38 | using OpenSim.Region.Environment.Interfaces; | 38 | using OpenSim.Region.Environment.Interfaces; |
39 | using OpenSim.Region.Environment.Scenes; | 39 | using OpenSim.Region.Environment.Scenes; |
40 | using System.Collections; | ||
40 | 41 | ||
41 | /***************************************************** | 42 | /***************************************************** |
42 | * | 43 | * |
@@ -105,7 +106,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest | |||
105 | return LLUUID.Zero; | 106 | return LLUUID.Zero; |
106 | } | 107 | } |
107 | 108 | ||
108 | public LLUUID StartHttpRequest(uint localID, LLUUID itemID, string url, List<string> parameters, string body) | 109 | public LLUUID StartHttpRequest(uint localID, LLUUID itemID, string url, List<string> parameters, Dictionary<string, string> headers, string body) |
109 | { | 110 | { |
110 | LLUUID reqID = LLUUID.Random(); | 111 | LLUUID reqID = LLUUID.Random(); |
111 | HttpRequestClass htc = new HttpRequestClass(); | 112 | HttpRequestClass htc = new HttpRequestClass(); |
@@ -150,6 +151,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest | |||
150 | htc.reqID = reqID; | 151 | htc.reqID = reqID; |
151 | htc.httpTimeout = httpTimeout; | 152 | htc.httpTimeout = httpTimeout; |
152 | htc.outbound_body = body; | 153 | htc.outbound_body = body; |
154 | htc.response_headers = headers; | ||
153 | 155 | ||
154 | lock (HttpListLock) | 156 | lock (HttpListLock) |
155 | { | 157 | { |
@@ -280,6 +282,7 @@ namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest | |||
280 | public HttpWebRequest request; | 282 | public HttpWebRequest request; |
281 | public string response_body; | 283 | public string response_body; |
282 | public List<string> response_metadata; | 284 | public List<string> response_metadata; |
285 | public Dictionary<string, string> response_headers; | ||
283 | public int status; | 286 | public int status; |
284 | public string url; | 287 | public string url; |
285 | 288 | ||
@@ -314,6 +317,9 @@ namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest | |||
314 | request.Method = httpMethod; | 317 | request.Method = httpMethod; |
315 | request.ContentType = httpMIMEType; | 318 | request.ContentType = httpMIMEType; |
316 | 319 | ||
320 | foreach (KeyValuePair<string, string> entry in response_headers) | ||
321 | request.Headers[entry.Key] = entry.Value; | ||
322 | |||
317 | // Encode outbound data | 323 | // Encode outbound data |
318 | if (outbound_body.Length > 0) { | 324 | if (outbound_body.Length > 0) { |
319 | byte[] data = Encoding.UTF8.GetBytes(outbound_body); | 325 | byte[] data = Encoding.UTF8.GetBytes(outbound_body); |