f"""
(async () => {
const object = {"BrowserId":3,"BrowserVersion":"106.0.0.0","BrandId":3,"ClientIntegratorId":1,"ClientTypeId":2,"JurisdictionId":2,"LanguageId":1,"TerritoryId":165,"SportsOrderingAreaId":3,"CategoryCName":"esports","GroupLimit":1000,"CorrelationId":"b593f4d9-2d3a-4aeb-90ad-6a7f0ce71411"};
const response = await fetch('https://sportsapi.com/api/Events/V2/GetTopGroups', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify(object)
})
.then(response => response.json())
.catch(error => console.warn(error));
return response
})
"""
// panic recover(if we have not a good response)
defer func() { //catch or finally
if r := recover(); r != nil { //catch
log.Println("Recover response request: ", r)
}
}()
panic: runtime error: invalid memory address or nil pointer dereference
context deadline exceeded (Client.Timeout exceeded while awaiting headers)
func Test() {
client := tools.HttpClient()
wg := new(sync.WaitGroup)
events := getSports(client)
for _, url := range events {
wg.Add(1)
go getOdds(client, url, wg)
}
wg.Wait()
fmt.Println()
fmt.Println("[Total events: ", len(events), "]")
}
b'\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x00ca\x00\x01\x16 f\x02\xd1\x9d\xbd\xdd@\xea\x830\x03#\x90bg0\xba\xd8xa\xeb\xc5&\x90\x12&f\x06\x03+C.\x06\x0b+CC\x05]\x05K+\x13\x06\x06\x1e\xb6\x14\xa0zV\x16\t\xb0.\x7fq\xa8.C$],\x0c\x86\xa6V\x06\xcc\x0cfV\xa6 \x03\x0c\xe4Y\xac\xc1\x8a/I\x82\x15s3\x18^\xd8ua\xc3\xc5\x86\x8bM\x176\x80\x9d\x02V\xc5\xca`\x08\xb4\xcc\x00(\xcf\xca\xb9\xa5V\x811"\xb5\x9b\x81)\x8e\xb1\x92a)3\x1b\x83\xa1\xbe\x91\x99\x9e)\x03\xeb\xb7S@\x19\x90\x03\x98\xd61\x1caX\xc2\x0c\xd4\xa4o\xa9g\xca\x04\x00\xc0\x8c\xb4\xa4\xd3\x00\x00\x00'
function(t) {
for (var e, r = t.length, n = "", i = 0, s = 0, a = 0; i < r; )
(s = t.charCodeAt(i)) < 128 ? (n += String.fromCharCode(s),
i++) : s > 191 && s < 224 ? (a = t.charCodeAt(i + 1),
n += String.fromCharCode((31 & s) << 6 | 63 & a),
i += 2) : (a = t.charCodeAt(i + 1),
e = t.charCodeAt(i + 2),
n += String.fromCharCode((15 & s) << 12 | (63 & a) << 6 | 63 & e),
i += 3);
return n
}