Moved from form to body, fixed broken playstate request.

This commit is contained in:
RazeLighter777 2020-06-26 11:55:43 -05:00
parent a8e859c831
commit 9665f4a193
3 changed files with 4 additions and 3 deletions

View File

@ -37,7 +37,7 @@ function PlaystateDefaults(id="" as string, params={} as object)
for each p in params.items()
new_params[p.key] = p.value
end for
return buildParams(new_params)
return FormatJson(new_params)
end function
function deleteTranscode(id)

View File

@ -79,8 +79,8 @@ end function
function postJson(req, data="" as string)
req.setMessagePort(CreateObject("roMessagePort"))
req.AddHeader("Content-Type", "application/json")
req.AsyncPostFromString(data)
resp = wait(30000, req.GetMessagePort())
if type(resp) <> "roUrlEvent"
return invalid

View File

@ -3,7 +3,8 @@ function get_token(user as String, password as String)
req = APIRequest(url)
encPass = CreateObject("roUrlTransfer")
json = postJson(req, "Username=" + user + "&Pw=" + encPass.Escape(password) )
json = postJson(req, FormatJson({ "Username": user, "Pw": password }))
if json = invalid then return invalid