http GET Request
-
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); } }
-
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); } }