mirror of
https://github.com/opensim/opensim.git
synced 2026-06-07 12:08:48 +08:00
Mantis#1398. Thank you kindly, cmickeyb for a patch that:
small patch to encode and send the outbound_body parameter in an http request. this enables post messages to send a body
This commit is contained in:
@@ -314,6 +314,16 @@ namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest
|
||||
request.Method = httpMethod;
|
||||
request.ContentType = httpMIMEType;
|
||||
|
||||
// Encode outbound data
|
||||
if (outbound_body.Length > 0) {
|
||||
byte[] data = Encoding.UTF8.GetBytes(outbound_body);
|
||||
|
||||
request.ContentLength = data.Length;
|
||||
Stream bstream = request.GetRequestStream();
|
||||
bstream.Write(data, 0, data.Length);
|
||||
bstream.Close();
|
||||
}
|
||||
|
||||
request.Timeout = httpTimeout;
|
||||
// execute the request
|
||||
response = (HttpWebResponse)
|
||||
@@ -362,4 +372,4 @@ namespace OpenSim.Region.Environment.Modules.Scripting.HttpRequest
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user