S
Steve Richter
I have a page that uses simple HTTP GET to do an ISBN lookup via
Amazon.com. The page works when I run it from //localhost. But I have
moved it to my godaddy.com shared hoster site, and I get errors on the
HttpWebRequest.GetResponse statement.
The remote server returned an error: (401) Unauthorized
also, when I use the network credentials object in the context of my
request, I get this error:
The underlying connection was closed: The server committed
an HTTP protocol violation.
Here is the web page I have prepared as I do battle with the godaddy
techs.
www.autocoder.com/demosite/AmazonQuery.aspx
click away at it, I dont think any harm can be done.
A code snippet follows. I am working under the assumption that the
problem resides with the config of the godaddy servers. Is there
something that has to be enabled in order for my asp.net code to send a
web request to another site? Are there magic words I can use to
convince the godaddy techs to this affect?
thanks,
-Steve
private void WebRequestTest( string InURL )
{
string line ;
StringBuilder sb = new StringBuilder( ) ;
HttpWebResponse resp ;
HttpWebRequest rqs = (HttpWebRequest)WebRequest.Create( InURL ) ;
rqs.MaximumAutomaticRedirections = 4;
rqs.MaximumResponseHeadersLength = 4;
// either user default credentials or the credentials specified on the
page.
if ( CheckBox1.Checked == false )
rqs.Credentials = CredentialCache.DefaultCredentials;
else
rqs.Credentials = new NetworkCredential( tbUser.Text,
tbPassword.Text, tbDomain.Text ) ;
// send the request to the remote site, get the response.
resp = (HttpWebResponse)rqs.GetResponse( ) ;
Amazon.com. The page works when I run it from //localhost. But I have
moved it to my godaddy.com shared hoster site, and I get errors on the
HttpWebRequest.GetResponse statement.
The remote server returned an error: (401) Unauthorized
also, when I use the network credentials object in the context of my
request, I get this error:
The underlying connection was closed: The server committed
an HTTP protocol violation.
Here is the web page I have prepared as I do battle with the godaddy
techs.
www.autocoder.com/demosite/AmazonQuery.aspx
click away at it, I dont think any harm can be done.
A code snippet follows. I am working under the assumption that the
problem resides with the config of the godaddy servers. Is there
something that has to be enabled in order for my asp.net code to send a
web request to another site? Are there magic words I can use to
convince the godaddy techs to this affect?
thanks,
-Steve
private void WebRequestTest( string InURL )
{
string line ;
StringBuilder sb = new StringBuilder( ) ;
HttpWebResponse resp ;
HttpWebRequest rqs = (HttpWebRequest)WebRequest.Create( InURL ) ;
rqs.MaximumAutomaticRedirections = 4;
rqs.MaximumResponseHeadersLength = 4;
// either user default credentials or the credentials specified on the
page.
if ( CheckBox1.Checked == false )
rqs.Credentials = CredentialCache.DefaultCredentials;
else
rqs.Credentials = new NetworkCredential( tbUser.Text,
tbPassword.Text, tbDomain.Text ) ;
// send the request to the remote site, get the response.
resp = (HttpWebResponse)rqs.GetResponse( ) ;