Announcement

Collapse
No announcement yet.

JSON Authentication to web server

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • JSON Authentication to web server

    Hi people, I am trying to authenticate to a web server using JSON. I guess I am formating my JSON wrong but can't seem to find the problem. Here is my code:

    Code:
    const server_url = "https://vrmapi.victronenergy.com/v2/auth/login"
    const headers="Content-Type: application/json; charset=UTF-8" 
    'const headers="Accept", "application/json" 
    dim data as string = chr(34) & "username" & chr(34) & ":" &chr(34) & "MyEmailAddress@gmail.com" & chr(34) & "," & chr(34) & "password" & chr(34) & ":" & chr(34) & "MyReallyCoolPassword" & chr(34)
    hs.writelog ("Vic", data)
    dim s as string = hs.URLAction(server_url, "POST", data, headers)
    hs.writelog ("Vic",s)
    The web site documentation is here: https://vrmapi.victronenergy.com/v2/docs?

  • #2
    Ok I have found a solution... anyone interested (as it is long)?

    Comment


    • #3
      Originally posted by mbirrell View Post
      Ok I have found a solution... anyone interested (as it is long)?
      I'm curious what you did - at first glance I didn't see { and } around the JSON string?

      Sent from my SM-N950U using Tapatalk

      Comment


      • #4
        Yes, I'm interested in seeing the solution - been trying to do a POST to a server that requires a password only (no username) and still haven't found exactly the right format using URLaction.

        Comment

        Working...
        X