Hi Judd!

Starting with liquidsoap 1.4.0, we introduced proper tuples so this:

x = (1, "abc", 2.3)

You can extract elements from a tuple this way:

let (first, second, third) = x

Hope that helps!
Romain

Le mar. 3 mars 2020 à 17:25, Judd West <westjga...@live.com> a écrit :

> Hi there,
>
>
>
> Before I upgraded LiquidSoap, I was using http.post to authenticate DJs 
> against Firebase Auth. I had a wrapper that returned “true” or “false” 
> depending if the user details were correct.
>
> In LiquidSoap:
>
>
>
> def authDj(u,p) =
>
>         ret = http.post(headers=[("Content-Type","application/json")],
> data="{\"user\":\"" ^ u ^ "\",\"password\":\"" ^ p ^ "\"}","
> http://localhost:3000/admin/dj-login/secretlmao";)
>
>         print(snd(ret))
>
>         if snd(ret) == "true" then
>
>                log(label='information', 'Auth Succ!.')
>
>                 true
>
>         else
>
>                log(label='information', 'Auth Nope!.')
>
>                 false
>
>         end
>
> end
>
>
>
>
>
>
>
> http.post used to return ( _ * _ ), but now return ( _ * _ * _ )  (status,
> headers, data), so it’s no longer a pair. How do I get the data now?
>
> Thanks,
> Judd West
> _______________________________________________
> Savonet-users mailing list
> Savonet-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/savonet-users
>
_______________________________________________
Savonet-users mailing list
Savonet-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to