refactor url encoded form requests

This commit is contained in:
Brahim Hadriche committed 2024-02-26 18:44:57 -05:00
1 parent edbfc86e56
commit f2ffb42876
4 files changed
+33 -30

No files matched your search

@@ -77,18 +77,15 @@ namespace Http
end if
end if
registerUrl = "https://www.youtube.com/api/lounge/pairing/register_pairing_code"
registerBody = {
req = HttpClient.Post("https://www.youtube.com/api/lounge/pairing/register_pairing_code", "")
req.UrlEncodedForm({
"app": "Playlet"
"pairing_code": pairingCode
"screen_id": m.loungeService.screenId
"screen_name": m.deviceName
"device_id": m.deviceId
}
})
body = UrlUtils.GetUrlEncodedForm(registerBody)
req = HttpClient.Post(registerUrl, body)
req.Header("Content-Type", "application/x-www-form-urlencoded")
res = req.Await()
if not res.IsSuccess()