access web server using raw HTTP...

Discussion in 'ASP .Net' started by Satinderpal Singh, Jun 2, 2004.

  1. Hello Everybody,

    How can we request a web server and get the response without using
    HttpWebRequest and HttpWebResponse object.

    I mean, how can we access it at a raw level.

    Regards
    Satinder
    Satinderpal Singh, Jun 2, 2004
    #1
    1. Advertising

  2. you mean TCP / sockets?

    Why? what's wrong with WebRequest and WebResponse?

    for Socket usage check the doc on System.Net.Sockets.
    http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemNetSockets.asp



    "Satinderpal Singh" <> wrote in message
    news:...
    >
    > Hello Everybody,
    >
    > How can we request a web server and get the response without using
    > HttpWebRequest and HttpWebResponse object.
    >
    > I mean, how can we access it at a raw level.
    >
    > Regards
    > Satinder
    >
    >
    Dino Chiesa [Microsoft], Jun 3, 2004
    #2
    1. Advertising

  3. You can always formulate a raw HTTP request as follows:

    string request = "GET / HTTP/1.1\r\nHost: <server>\r\n\r\n";

    assuming that you have a socket "client" which is connected to the server,
    you can do:

    byte [] rawbytes = Encoding.ASCII.GetBytes(request);
    client.Send(rawbytes,0,rawbytes.Length, SocketFlags.None);

    feroze
    -----------------

    This posting is provided as-is. It offers no warranties and assigns no
    rights.

    -----------------

    "Satinderpal Singh" <> wrote in message
    news:...
    >
    > Hello Everybody,
    >
    > How can we request a web server and get the response without using
    > HttpWebRequest and HttpWebResponse object.
    >
    > I mean, how can we access it at a raw level.
    >
    > Regards
    > Satinder
    >
    >
    Feroze [msft], Jul 14, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Satinderpal Singh

    access web server using raw HTTP...

    Satinderpal Singh, Jun 2, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    325
    John Timney \(Microsoft MVP\)
    Jun 2, 2004
  2. yawnmoth
    Replies:
    8
    Views:
    1,918
    yawnmoth
    Aug 21, 2006
  3. Replies:
    3
    Views:
    790
    Guillermo
    Apr 26, 2007
  4. Replies:
    5
    Views:
    1,066
  5. lkcl
    Replies:
    6
    Views:
    1,032
Loading...

Share This Page