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. http GET Request

http GET Request

Scheduled Pinned Locked Moved C#
helpquestionsysadminsalesworkspace
3 Posts 2 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.
  • S Offline
    S Offline
    steve_rm
    wrote on last edited by
    #1

    Hello, I am using http to get a request from a server. The server has been setup to receive a customer ID and return the balance. However, I am getting an error message with the code I am using below: "Invalid URI: The URI scheme is not valid." From what I can make out by using wireshark is that the server expects a customerID and the balance will be returned. I am not sure that the data is another parameter that the server expects. So how can I write the URL that expects a parameter like the customer ID? Many thanks for any extra help, private void btnGetBalance_Click(object sender, EventArgs e) { try { HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("000.000.00.00:8080/billing/servlet/comm.billing.GetBalance?Date=17:54:24&CustomerID=8057"); HttpWebResponse res = (HttpWebResponse)wr.GetResponse(); StreamReader sr = new StreamReader(res.GetResponseStream()); string balance = sr.ReadToEnd(); } catch(UriFormatException ex) { MessageBox.Show(ex.Message); } catch(Exception ex) { MessageBox.Show(ex.Message); } }

    S 1 Reply Last reply
    0
    • S steve_rm

      Hello, I am using http to get a request from a server. The server has been setup to receive a customer ID and return the balance. However, I am getting an error message with the code I am using below: "Invalid URI: The URI scheme is not valid." From what I can make out by using wireshark is that the server expects a customerID and the balance will be returned. I am not sure that the data is another parameter that the server expects. So how can I write the URL that expects a parameter like the customer ID? Many thanks for any extra help, private void btnGetBalance_Click(object sender, EventArgs e) { try { HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("000.000.00.00:8080/billing/servlet/comm.billing.GetBalance?Date=17:54:24&CustomerID=8057"); HttpWebResponse res = (HttpWebResponse)wr.GetResponse(); StreamReader sr = new StreamReader(res.GetResponseStream()); string balance = sr.ReadToEnd(); } catch(UriFormatException ex) { MessageBox.Show(ex.Message); } catch(Exception ex) { MessageBox.Show(ex.Message); } }

      S Offline
      S Offline
      steve_rm
      wrote on last edited by
      #2

      Problem solved. I missed of the http://

      L 1 Reply Last reply
      0
      • S steve_rm

        Problem solved. I missed of the http://

        L Offline
        L Offline
        leppie
        wrote on last edited by
        #3

        Subtle, but it happens :)

        xacc.ide - now with TabsToSpaces support
        IronScheme - 1.0 alpha 4a out now (29 May 2008)

        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