Greetings!
I am currently creating a program that will retrieve information from a
web site based on user input. I have the system working correctly, but
am running into a problem (that I probably should have checked for in
the beginning ;)
Summary:
Using an HTTPRequest, I want to be able to retrieve the page a server
would send with an error (like a custom 404) instead of getting a
WebException.
Detailed:
The user can determine what web page it is going to get data from. The
problem I discovered is that one of my test files has moved - making the
server return a 404.
The problem is, instead of returning the actual data from the server,
I'm getting an exception. Most servers have their own custom 404 pages,
and I would like the user to be able to see that.
Currently, the only solution I can think of is to make a general socket
stream to retrieve the web page and send the data directly (if the web
page is not found), but that will be clumsy and I would rather do it
right than a cruddy workaround.
Is there any other options? Thank you for assistance! 3 3028
if you catch the webexception, the server's content s/b part of the
exception information. i had the same problem when web services being
consumed returned an error 500...the ws was providing specific details about
the error but i was puzzled about how to get the details...they' re in the
exception.
"bag" <pu****@horkmai l.com> wrote in message
news:Xn******** *************** ********@207.21 7.125.205...
| Greetings!
| I am currently creating a program that will retrieve information from a
| web site based on user input. I have the system working correctly, but
| am running into a problem (that I probably should have checked for in
| the beginning ;)
|
| Summary:
| Using an HTTPRequest, I want to be able to retrieve the page a server
| would send with an error (like a custom 404) instead of getting a
| WebException.
|
| Detailed:
| The user can determine what web page it is going to get data from. The
| problem I discovered is that one of my test files has moved - making the
| server return a 404.
|
| The problem is, instead of returning the actual data from the server,
| I'm getting an exception. Most servers have their own custom 404 pages,
| and I would like the user to be able to see that.
|
| Currently, the only solution I can think of is to make a general socket
| stream to retrieve the web page and send the data directly (if the web
| page is not found), but that will be clumsy and I would rather do it
| right than a cruddy workaround.
|
| Is there any other options? Thank you for assistance!
if you catch the webexception, the server's content s/b part of the
exception information. i had the same problem when web services being
consumed returned an error 500...the ws was providing specific details about
the error but i was puzzled about how to get the details...they' re in the
exception.
"bag" <pu****@horkmai l.com> wrote in message
news:Xn******** *************** ********@207.21 7.125.205...
| Greetings!
| I am currently creating a program that will retrieve information from a
| web site based on user input. I have the system working correctly, but
| am running into a problem (that I probably should have checked for in
| the beginning ;)
|
| Summary:
| Using an HTTPRequest, I want to be able to retrieve the page a server
| would send with an error (like a custom 404) instead of getting a
| WebException.
|
| Detailed:
| The user can determine what web page it is going to get data from. The
| problem I discovered is that one of my test files has moved - making the
| server return a 404.
|
| The problem is, instead of returning the actual data from the server,
| I'm getting an exception. Most servers have their own custom 404 pages,
| and I would like the user to be able to see that.
|
| Currently, the only solution I can think of is to make a general socket
| stream to retrieve the web page and send the data directly (if the web
| page is not found), but that will be clumsy and I would rather do it
| right than a cruddy workaround.
|
| Is there any other options? Thank you for assistance!
I added a watch to the webexception and looked all through the data and
could not find the actual server content. Can you give me the specific
location?
Thanks for the help.
"steve" <a@b.com> wrote in news:10******** *****@corp.supe rnews.com: if you catch the webexception, the server's content s/b part of the exception information. i had the same problem when web services being consumed returned an error 500...the ws was providing specific details about the error but i was puzzled about how to get the details...they' re in the exception. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Gregory A Greenman |
last post by:
I'm trying to write a program in vb.net to automate filling out a
series of forms on a website. There are three forms I need to
fill out in sequence. The first one is urlencoded. My program is
able to fill that one out just fine.
The second form is multipart/form-data. Unfortunately, I haven't
been able to fill that out in a way that makes the server happy.
I set up a copy of this form at my web site so that I could see
exactly what a...
|
by: thomas peter |
last post by:
I am building a precache engine... one that request over 100 pages on an
remote server to cache them remotely...
can i use the HttpWebRequest and WebResponse classes for this? or must i use
the MSHTML objects to really load the HTML and request all of the images on
site?
string lcUrl = http://www.cnn.com;
// *** Establish the request
|
by: Satinderpal Singh |
last post by:
Hi everyone,
We are using HttpWebRequest to create a request to a URI, which requires us to login first. In order to process all the transactions, first we have to login and get the cookie value in a variable and make the request again with that cookie as a header value (Digest Authentication).
But, the problem we are facing is: That the HttpWebRequest is getting two responses simultaneously, which means that the code should wait after the...
|
by: Jason |
last post by:
I'm having a hard time getting a call to HttpWebRequest's
GetRequestSteam to work. Each time I try to run it, I get the
following error:
The underlying connection was closed: Unable to connect to the
remote server.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
|
by: bag |
last post by:
Greetings!
I am currently creating a program that will retrieve information from a
web site based on user input. I have the system working correctly, but
am running into a problem (that I probably should have checked for in
the beginning ;)
Summary:
Using an HTTPRequest, I want to be able to retrieve the page a server
would send with an error (like a custom 404) instead of getting a
WebException.
| |
by: boxboy |
last post by:
Hi, I'm writing a console application and am having a problem with HttpWebRequest
when posting data to a webserver. A "System.Net.WebException: The server committed a
protocol violation" is always being thrown when getting the response from a specific
host. I'm pretty sure the framework's implementation doesn't like the formating or
status code of the returned response header. It throws the exception without giving
me a way of handling it...
|
by: barrybevel |
last post by:
Hi,
I'm trying to login to the www.vodafone.ie website using
HttpWebRequest.
It works fine with IE/Firefox and the .NET Web Control too, just not
with my code.
I think it's a redirect 302 problem.
I'm using this code in a ASP.NET 2.0 application just in case that
matters,
maybe someone knows a better way to do this?
|
by: =?Utf-8?B?U2ltb25EZXY=?= |
last post by:
Hi
I have a utility class, called MailHandler, that I wrote to read and operate
on emails on an Exchange server using WebDAV. The WebDAV SQL statements are
sent using an HttpWebRequest object.
This worked fine in a .NET 1.1 project. I have copied the same Mailhandler
class into a .NET 2.0 project. This, too, worked fine when I initially
tested it, running as a Windows Forms app on my machine (running under my
network account). ...
|
by: =?Utf-8?B?TGFycnlLdXBlcm1hbg==?= |
last post by:
Our WebDev team seems to have found a problem that exposes a bug in .NET 2.0.
This problem can be shown when trying to access a WebService using SSL and
through a proxy server after using the HttpWebRequest object.
Under normal circumstances I am able to use the webservice without any
problems. But after using an HttpWebRequest object to make a call to a
website
all subsequent attempts to use the WebService will fail with a 401...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |