473,396 Members | 1,783 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Using webclient to send request to jsp page

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?

Nov 19 '05 #1
1 3454
Kevin wrote:
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,
--
http://www.joergjooss.de
mailto:ne********@joergjooss.de
Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Crirus | last post by:
Hello! Last year I used Framework's 1.0 WebControl to connect to a server designed by me with sockets and TCP. The client run in a html as activex. Right now, I reactivated that project... server...
7
by: Crirus | last post by:
Hi all! I use a webClient for requesting data from a server of mine. Should I worry about long ammount of data sent by server in the client side? Or, another way, should I send some kind of a...
1
by: Scampi | last post by:
Hi, I've been working on an application to do some 'scraping' of web content, using the WebClient class. I'm using code rather like the following.. Dim objWebClient As New WebClient Dim...
0
by: Mavis | last post by:
I have created an application using the WebRequest and HttpWebResponse .net classes. SSL credentials are used. The app receives a web page as a string, parses the data and locates files that I want...
1
by: neoret | last post by:
Hi there. I need to perform an upload of a document using HTTP post. This has to be done from my windows form using C#. My challenge is: 1: To send - the word document 2: To attach several...
4
by: Michael Duclon | last post by:
Does anyone know how I might use the webclient class to navigate to a web page in a vb.net app, and then if a JavaScript popup appears from the web page I go to, read the message in it or content...
4
by: Natalia | last post by:
Hello, I need to provide the ability to post file and some form elements via our website (asp.net) to the third party website (asp page). On http://aspalliance.com/236#Page4 - I found great...
3
by: Giggi | last post by:
Hi! I need to pass some strings via an HTTP POST from page1 (in my app) to a page on another server. I stored my data in a NameValueCollection and then sent it using WebClient.UploadValues....
2
by: Jeff | last post by:
ASP.NET 2.0 I'm working on a asp.net 2.0 website which needs to access a database on another server via an request. This database is placed on another server which is not based on ASP.NET, but...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.