HttpWebRequest problem using WebRequest.Method and

Results 1 to 2 of 2

Thread: HttpWebRequest problem using WebRequest.Method and

  1. #1
    Join Date
    Dec 1969

    Default HttpWebRequest problem using WebRequest.Method and

    I&#039;m coding up an app that requires HTTP-POST.The request is being sent from a web server to external web server via HTTPS.<BR>Currently I am only testing this via HTTP.<BR>When I leave out the Request.Method = "Post" from my code I receive the correct information back from test servers (both intranet and internet) When I include the Request.Method = "Post" I receive a timeout error. Any help would be greatly appreciated. A sample of the code is below<BR><BR>HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("" );<BR>//OFFENDING LINES COMMENTED OUT<BR>//myRequest.Method = "Post";<BR>//myRequest.ContentType = "application/x-www-form-urlencoded";<BR>HttpWebResponse webResponse = (HttpWebResponse)myRequest.GetResponse();<BR>Strea mReader myStreamReader = new StreamReader(webResponse.GetResponseStream(), Encoding.ASCII);<BR>try<BR> {<BR> string outPutString;<BR> outPutString = myStreamReader.ReadToEnd();<BR> lblPostRes.Text = outPutString;<BR> }<BR> catch<BR> {<BR> Response.Write("Failure to complete request");<BR> }<BR> myStreamReader.Close();<BR> }<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: HttpWebRequest problem using WebRequest.Method

    just guessing here but<BR><BR>You aren&#039;t POSTing anything. It is just a GET request is it not?<BR><BR>I assume GET is the default when nothjing specified

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts