I have been trying to send this CURL Command below, and tried a few examples out there but none of them work, as I need to send the username:password and not sure if this is a HEADER and also how to send the BODY of the GET Request. Just looking for a bit of an example which sends user:password as can't find one anywhere?
curl --data {"version":"1.1","method":"room_verify","params":{"account":{"type":"room","value":"0"}}} --user test:test http://ressrv.worldweb.com:8001/json_pos_generic/22
Here is my Code for this:
Dim url As String = "http://ressrv.worldweb.com:8001/json_pos_generic/22"
Dim wrq = CType(Net.WebRequest.Create(url), HttpWebRequest)
Dim postString As String = "{""version"":""1.1"",""method"":""room_verify"",""params"":{""account"":{""type"":""room"",""value"":""0""}}}"
wrq.Method = "POST"
wrq.ContentType = "application/json"
wrq.ContentLength = postString.Length
wrq.Credentials = New NetworkCredential("test", "test")
Dim wrqWriter As New StreamWriter(wrq.GetRequestStream())
wrqWriter.Write(postString)
wrqWriter.Close()
Dim responseReader As New StreamReader(wrq.GetResponse().GetResponseStream())
Dim responseData As String = responseReader.ReadToEnd()
Any Help or Guidance would be much appreciated ...