Creating an HTTP client

Nov 26, 2010 at 8:01 PM

I would like to create an HTTP client for singularity. Is the following a good way of implementing this?

  1. Create an instance of Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp).
  2. Socket.Connect("hostname", 80) to connect on port 80.
  3. Socket.Send() the HTTP request string.
  4. Socket.Receive() the HTTP response string.
  5. Socket.Close().

-sashabu