memw
✅ Consistent way to Authorize with HttpClient?
So i'm trying to send a request to the discord API with <HttpClient> and i tried a couple ways to authorize this being one:
But this one doesn't work and it always will send me an unauthorized response
401
Before anything, yes i tried the token, i Console.Writeline'd the token and i made the same request with insomnia client and it works there.6 replies
❔ Reflections and generics
So i have a type instance list and i'm iterating trough all the fields that the propertyType.Name.Contains("ExtensionConfig"), that type has a method which i need to invoke foreach field and i'm iterating trough the fields
So basically the problem comes when i do
(field as PropertyInfo).GetValue(type)
shows invalid cast exception, and i can't cast because the target type has a generic type which in every field is different96 replies
How do delegates work
I have a little problem understanding what type i need to pass a delegate to AddEventHandler because i'm getting the function from reflection and MethodInfo.CreateDelegate tells me i need to pass a type which i don't understand what would that type be for or what derives from a delegate exactly
25 replies