need assistance httpwebrequest object
i'm perplexing build surrogate way .net, nonetheless i'm carrying problem duplicating headers tide ask new request. i am sourroundings headers new request, since i wish surrogate support soap requests. here apportionment code. i post all need, nonetheless wholly biased seems associated emanate i am having:
httpapplication app = (httpapplication)sender; // sender context.beginrequest event
httprequest crntreq = app.request; // set anxiety ask vigilant easier access
httpwebrequest proxyreq = (httpwebrequest)httpwebrequest.create(crntreq.url.absoluteuri);
// parse headers tide httpcontext.request.headers supplement any name->value
// new ask object
foreach (string header crntreq.headers)
{
proxyreq.headers.add(header, crntreq.headers[header]); // throws difference :(
}
when formula hits foreach loop, throws an difference headers.add function. i'm presumption collection opening restrictions, confidence purposes. appears header values permitted properties httpwebrequest vigilant itself. however box i'd rather absolved condensation set properties manually. difference i'm receiving is:
{"this header contingency run-down controlling suitable property.\r\nparameter name: name"}
thanks lay your help,
cjam
Comments
Post a Comment