Z
Zoe Hart
I maintaining or trying to maintain a relatively simply HttpHandler. The
idea is that it takes a request to http://myhandler/url/someURL and creates
a request to http://someaddress/someresource. When it gets the response, it
streams that response back to the original incoming request. So it's
basically just mapping url/someURL to someaddress/someresource, with the
mapping information being supplied in the handler's config file.
Within the HttpHandler code, we're using HttpWebRequest to create the
internal request to the mapped resource and HttpWebResponse to capture the
response that we then stream back as the response to the original request.
This works well when the HttpWebRequest generates an HTTP 200 response. When
the generated HttpWebRequest results in an Http 4xx or 5xx, instead of
getting the actual response streamed back to the original request, I'm
getting an HTTP 500 with the message "The remote server returned an error:
(xxx)" where xxx is the HTTP status code of the response to the internally
generated request. I assume that either HttpWebRequest or HttpWebResponse is
doing this wrapping of the original response. How can I get the actual
response code and content to the internally generated request streamed back
to the original request instead of this wrapper.
Thanks,
Zoe
idea is that it takes a request to http://myhandler/url/someURL and creates
a request to http://someaddress/someresource. When it gets the response, it
streams that response back to the original incoming request. So it's
basically just mapping url/someURL to someaddress/someresource, with the
mapping information being supplied in the handler's config file.
Within the HttpHandler code, we're using HttpWebRequest to create the
internal request to the mapped resource and HttpWebResponse to capture the
response that we then stream back as the response to the original request.
This works well when the HttpWebRequest generates an HTTP 200 response. When
the generated HttpWebRequest results in an Http 4xx or 5xx, instead of
getting the actual response streamed back to the original request, I'm
getting an HTTP 500 with the message "The remote server returned an error:
(xxx)" where xxx is the HTTP status code of the response to the internally
generated request. I assume that either HttpWebRequest or HttpWebResponse is
doing this wrapping of the original response. How can I get the actual
response code and content to the internally generated request streamed back
to the original request instead of this wrapper.
Thanks,
Zoe