This allows
HttpRequestMessageProperty request = new HttpRequestMessageProperty ();
request.Headers.Add ("Foo", "Bar");
OperationContext.Current.OutgoingMessageProperties.Add (HttpRequestMessageProperty.Name, request);
The code was already there, but disabled for the NET_2_1 profile.
string pname = HttpRequestMessageProperty.Name;
if (message.Properties.ContainsKey (pname)) {
HttpRequestMessageProperty hp = (HttpRequestMessageProperty) message.Properties [pname];
-#if !NET_2_1 // FIXME: how can this be done?
foreach (var key in hp.Headers.AllKeys)
if (!WebHeaderCollection.IsRestricted (key))
web_request.Headers [key] = hp.Headers [key];
-#endif
web_request.Method = hp.Method;
// FIXME: do we have to handle hp.QueryString ?
if (hp.SuppressEntityBody)