Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Sending http request to server using C#.net

Sending http request to server using C#.net

Scheduled Pinned Locked Moved C#
csharphelpsysadmin
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    D i x y
    wrote on last edited by
    #1

    hello sir, I have a problem while developing an appliation in which i have to send http request to server and then receive response from server please help me

    V R M 3 Replies Last reply
    0
    • D D i x y

      hello sir, I have a problem while developing an appliation in which i have to send http request to server and then receive response from server please help me

      V Offline
      V Offline
      Vasudevan Deepak Kumar
      wrote on last edited by
      #2

      Check out this article http://www.codeproject.com/useritems/Browsing_the_WEB_with_C_.asp[^]

      Vasudevan Deepak Kumar Personal Homepage Tech Gossips

      1 Reply Last reply
      0
      • D D i x y

        hello sir, I have a problem while developing an appliation in which i have to send http request to server and then receive response from server please help me

        R Offline
        R Offline
        Ravi Bhavnani
        wrote on last edited by
        #3

        Does this[^] article help? /ravi

        This is your brain on Celcius Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

        1 Reply Last reply
        0
        • D D i x y

          hello sir, I have a problem while developing an appliation in which i have to send http request to server and then receive response from server please help me

          M Offline
          M Offline
          MCEdwards
          wrote on last edited by
          #4

          I .Net Framework 2 there is a very useful calls called the System.Net.WebClient class. This class contains methods that allow you to quickly make http and https requests and process the return. You can set headers and post information. I have used it to create a http post to remote servers and receive a response. Here is some code: Byte [] PostData = System.Text.Encoding.ASCII.GetBytes("hello world"); System.Net.WebClient client = new System.Net.WebClient(); Byte[] Response = oClient.UploadData("http://www.somewhereintheworld.com", "POST", PostData); return System.Text.Encoding.ASCII.GetString(Response); These first line just turns the post data I want to send into a byte array. I create the WebClient object on the second line and then on the third line I tell the client to send the data to the target website as a post action with the byte array I have created. This returns a byte array that I then need to turn back into a string which is done on the last line. Happy browsing.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups