Using webclient to send request to jsp page

G

Guest

I need to send a request to a jsp with data added to the http request header.
I am using Webclient to send the request and I am putting the returned string
(html) into a label on my aspx page but the returned html has a relative
redirect that is not working. I have tried using the <base> tag with out
success, also tried chaning the url in the <meta> tag to an absolute address
and neither worked. I still get an 404 error for the redirected page because
the url is relative to my application server not the jsp server.

Any ideas how to solve this issue? Is there a better way to get the values I
need into the http request header and call the jsp page?
 
J

Joerg Jooss

Kevin said:
I need to send a request to a jsp with data added to the http request
header. I am using Webclient to send the request and I am putting
the returned string (html) into a label on my aspx page but the
returned html has a relative redirect that is not working. I have
tried using the <base> tag with out success, also tried chaning the
url in the <meta> tag to an absolute address and neither worked. I
still get an 404 error for the redirected page because the url is
relative to my application server not the jsp server.

That violates the HTTP 1.1 spec. Location headers (which are used for
redirects) *must* be absolute URIs.

If that cannot be fixed on the server-side, you need to use
HttpWebRequest, set AutoAllowDirect to false and handle the appropriate
30x HTTP status yourself.


Cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top