socket connection to a url

sde

Well-known member
Joined
Aug 28, 2003
Messages
160
Location
us.ca.fullerton
i have been trying to figure out a way to send this xml data to ups for rate quotes.

the goal here is to connect to this url, and send data. then receive the data it sends back.

i get an exception because im trying to connect to a url instead of an IP.

how do i connect to this url and send the data to the appropriate place?

here is an example of what im attempting:
Code:
TcpClient tc=new TcpClient("https://www.ups.com/ups.app/xml/Rate");

NetworkStream ns=tc.GetStream();
StreamWriter sw=new StreamWriter(ns);

sw.WriteLine(xml);
sw.Flush();

StreamReader sr=new StreamReader(ns);
txtResponse.Text = sr.ReadLine();
 
yes thanks, .. i should have mentioned that. i can connect to ups.com, but wasnt sure how to navigate to the subdirectory where the program was located which returns the xml string based on what i sent it.

i achieved this my just sending the xml request as https post data.
 
Back
Top