468,532 Members | 1,725 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,532 developers. It's quick & easy.

Passing HTTP Headers

Hi all,

I need to pass HTTP Headers from onw web site to another web site as I
need to post a form on one web applications page to page on different
web site both sites are under my control,
and user credentials are to be passed from HTTP headers

I have used HTTP modules in asp.net and registerred events like
app_PreRequestHandlerExecute, begin_reuest
whenever I try to add a header in request headers collection it throws
exception as its read only

Thanks in advance

Feb 11 '06 #1
4 1983
Wouldn't it be easier with the Webclient class? It seems to me that it
submits to a form and handles credentials at the same time.

"Purushottam Khandebharad" <pu***********@gmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
Hi all,

I need to pass HTTP Headers from onw web site to another web site as I
need to post a form on one web applications page to page on different
web site both sites are under my control,
and user credentials are to be passed from HTTP headers

I have used HTTP modules in asp.net and registerred events like
app_PreRequestHandlerExecute, begin_reuest
whenever I try to add a header in request headers collection it throws
exception as its read only

Thanks in advance

Feb 12 '06 #2
Hi Ken,
I tried following option

Using "HTTPWebRequest" class we can create a request and add
request headers to that request As follows

HttpWebRequest myHttpWebRequest;

myHttpWebRequest=(HttpWebRequest)WebRequest.Create ("http://Application2/Page1.aspx");

myHttpWebRequest.Headers.Add ("Key","Value");

My requirement is so that I don't want to get the response of this
page back in response stream.

I need to open this HTTP request in the browser like Response.Redirect
() does.

Problems with this approach:
i. Can not open the request in browser like Response.Redirect ().

Can you suggest some way out
Thanks in advance

Feb 13 '06 #3
Thus wrote Pune,
Hi Ken,
I tried following option
Using "HTTPWebRequest" class we can create a request and add request
headers to that request As follows

HttpWebRequest myHttpWebRequest;

myHttpWebRequest=(HttpWebRequest)WebRequest.Create ("http://Application
2/Page1.aspx");

myHttpWebRequest.Headers.Add ("Key","Value");

My requirement is so that I don't want to get the response of this
page back in response stream.

I need to open this HTTP request in the browser like Response.Redirect
() does.


Then why don't you redirect to the page directly (or after adding some parameters
to the query string)?

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
Feb 13 '06 #4
Hi Joerg,

the ans is simple security reasons wont allow me to use query string

Joerg Jooss wrote:
Thus wrote Pune,
Hi Ken,
I tried following option
Using "HTTPWebRequest" class we can create a request and add request
headers to that request As follows

HttpWebRequest myHttpWebRequest;

myHttpWebRequest=(HttpWebRequest)WebRequest.Create ("http://Application
2/Page1.aspx");

myHttpWebRequest.Headers.Add ("Key","Value");

My requirement is so that I don't want to get the response of this
page back in response stream.

I need to open this HTTP request in the browser like Response.Redirect
() does.


Then why don't you redirect to the page directly (or after adding some parameters
to the query string)?

Cheers,
--
Joerg Jooss
ne********@joergjooss.de


Feb 15 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by Antoni | last post: by
3 posts views Thread by Pjotr Wedersteers | last post: by
7 posts views Thread by Michael Foord | last post: by
6 posts views Thread by Mark | last post: by
12 posts views Thread by martin.lanny | last post: by
5 posts views Thread by scott | last post: by
25 posts views Thread by Marcel | last post: by
9 posts views Thread by JRough | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.