Re: HttpWebRequest.GetResponse on POST returns 405 method not allowed
- From: GlennLanier <GlennLanier.1qeufy@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 10 Jun 2005 08:15:07 -0400
Craig Deelsnyder Wrote:
>
> A server can refuse to accept a POST request for a certain page, only
> a
> GET. Perhaps they can also do so based on referrer, so outside sites
> cannot POST into the site.
>
I can POST to this page normally, the URL specified localhost which
resolved to 127.0.0.1. When I changed it to the actual IP of my
machine, it worked. Not sure why, because I can (and usually do) access
the machine using http://localhost/. Since this is a development server,
I modified the code slightly:
string sServer = Request.ServerVariables["SERVER_NAME"];
string sURL = string.Format(@"http://{0}/PostToMe.html", sServer);
Craig Deelsnyder Wrote:
>
> Have you verified all of this is not true? Also verify you are
> POSTing
> to the correct URL, and that all fields that are expected by the
> receiving site are included in your form.
>
All of this is correct -- the page doesn't require any variables, and
simply does a dump of all variables it receives -- great for testing!
I have worked around the problem by specifying a server name, but would
love to know why localhost didn't work.
Thanks,
Glenn
--
GlennLanier
------------------------------------------------------------------------
GlennLanier's Profile: http://www.highdots.com/forums/member.php?userid=211
View this thread: http://www.highdots.com/forums/showthread.php?t=1495817
.
- References:
- HttpWebRequest.GetResponse on POST returns 405 method not allowed
- From: GlennLanier
- Re: HttpWebRequest.GetResponse on POST returns 405 method not allowed
- From: Craig Deelsnyder
- HttpWebRequest.GetResponse on POST returns 405 method not allowed
- Prev by Date: Re: Pager style
- Next by Date: Re: somebody help me answer this?
- Previous by thread: Re: HttpWebRequest.GetResponse on POST returns 405 method not allowed
- Next by thread: Page load
- Index(es):
Relevant Pages
|