House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  .NET Technical Talk (Net-Talk)

Form Post Result

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Duane,
Nathan Strutz
06/04/08 12:26 P
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Duane
06/04/2008 11:46 AM

I am try to send data via a post to a third party server. The code I am using is below. I can't really tell if the post is working properly, is there a way to get the data that the third party site is returning in the post? Thanks, Duane ASCIIEncoding encoding = new ASCIIEncoding(); HttpWebRequest req = (HttpWebRequest)WebRequest.Create("https://localhost/app/view:Join/signupId: 12587"); string postData = ""; postData += "member_id="; postData += "&prev_member_email="; postData += "&signup_name=none"; postData += "&private_set=2"; postData += "&groups[]=4352,6389"; byte[] data = encoding.GetBytes(postData); req.Method = "POST"; req.ContentType = "application/x-ww-form-urlencoded"; req.ContentLength = data.Length; Stream reqStream = req.GetRequestStream(); // Send the data. reqStream.Write(data, 0, data.Length); reqStream.Close();

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Nathan Strutz
06/04/2008 12:26 PM

Duane, You made a WebRequest, now get the WebResponse: http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.getresponse.aspx HttpWebResponse response = (HttpWebResponse) req.GetResponse(); Then you can get the HTTP status code of your request, as well as stream the returned data (probably HTML ?) into your app. Hope that helps... hope it's right... only done it once. -- nathan strutz http://www.dopefly.com/ ----- Excess quoted text cut - see Original Post for more -----


<< Previous Thread Today's Threads Next Thread >>

Search net-talk

May 21, 2013

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Designer, Developer and mobile workflow conference