Moved from form to body, fixed broken playstate request.
This commit is contained in:
parent
a8e859c831
commit
9665f4a193
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user