Forums

Developers

There is currently 1 person viewing this thread.
Mr Ed
18 Apr 20 00:19
Joined:
Date Joined: 02 Feb 02
| Topic/replies: 538 | Blogger: Mr Ed's blog
Struggling to discover what is wrong with my VB.net code

    Dim user As String
    Dim pass As String
    user = "xxx"
    pass = "xxx"
    Dim request As WebRequest = WebRequest.Create("https://api.sm**k**s.com/v3/sessions/")
    request.Method = "POST"
    Dim postData As String
    postData = "{""username"": """ + user + """,""password"": """ + pass + """}"
    Dim byteArray As Byte() = System.Text.Encoding.UTF8.GetBytes(postData)
    request.ContentType = "application/json"
    request.ContentLength = byteArray.Length
    Dim dataStream As System.IO.Stream = request.GetRequestStream()
    dataStream.Write(byteArray, 0, byteArray.Length)
    dataStream.Close()
    Dim response As WebResponse = request.GetResponse()

I get a (401) unauthorized error. Ive tried asking on various forums but haven't received any useful responses. Any advice appreciated

Post your reply

Text Format: Table: Smilies:
Forum does not support HTML
Insert Photo
Cancel
sort by:
Show
per page
Replies: 6
By:
11kv
When: 15 Sep 20 21:58
{/img}https://community.cdnbf.net/community.betfair.com/user/11kv/3a62b3d5e3df64e898d35afc90cf62e6.jpg?v=260400{img/}
By:
11kv
When: 15 Sep 20 21:59
[/img]https://community.cdnbf.net/community.betfair.com/user/11kv/3a62b3d5e3df64e898d35afc90cf62e6.jpg?v=26040[img/]
By:
11kv
When: 15 Sep 20 22:00
[img/]https://community.cdnbf.net/community.betfair.com/user/11kv/3a62b3d5e3df64e898d35afc90cf62e6.jpg?v=26040[/img]
By:
11kv
When: 15 Sep 20 22:02
[img]https://community.cdnbf.net/community.betfair.com/user/11kv/3a62b3d5e3df64e898d35afc90cf62e6.jpg?v=26040[img/]
By:
11kv
When: 15 Sep 20 22:03
By:
johnnythebull
When: 02 Dec 20 13:18
,.;
sort by:
Show
per page

Post your reply

Text Format: Table: Smilies:
Forum does not support HTML
Insert Photo
Cancel
‹ back to topics
www.betfair.com