C
C#2y ago
VIBEWOOD

Help me decode an old script (inexperienced)

I'm trying to understand an old .cs file, but having experience only in python im finding it difficult. more info in messages
23 Replies
VIBEWOOD
VIBEWOOD2y ago
ill send the entire file
VIBEWOOD
VIBEWOOD2y ago
im attempting to rewrite this in python, and im trying to figure out what is appended to the variable response and in what order
Thinker
Thinker2y ago
.Result thisisalright
VIBEWOOD
VIBEWOOD2y ago
thanks a lot, but im not sure how to print it or anything how do i find contents of a variable?
Thinker
Thinker2y ago
What are you actually trying to do?
RTXPower
RTXPower2y ago
You are using GetAsync so please await it
VIBEWOOD
VIBEWOOD2y ago
im trying to rewrite this but in python, and ive got most of it down but i have no understanding of c#
RTXPower
RTXPower2y ago
Same for ReadAsStringAsync
Thinker
Thinker2y ago
Well, this isn't a Python server catsip
RTXPower
RTXPower2y ago
$python
RTXPower
RTXPower2y ago
Here ya go
VIBEWOOD
VIBEWOOD2y ago
yes, but i need to understand the c# part of it
RTXPower
RTXPower2y ago
Oh so u dont understand the code?
VIBEWOOD
VIBEWOOD2y ago
correct i dont understand c# at all
RTXPower
RTXPower2y ago
Basically its doing a GET request to that endpoint and reads the content as string.
VIBEWOOD
VIBEWOOD2y ago
okay understood, thank you would you also be able to tell me what the .Result variable is?
RTXPower
RTXPower2y ago
.Result is used because the method isn't awaited. It just returns the result of the GET request But if awaited, result will return automatically
VIBEWOOD
VIBEWOOD2y ago
i was under the impression that it would be a POST request because i thought that this script uploaded files
RTXPower
RTXPower2y ago
post request would be SendAsync
VIBEWOOD
VIBEWOOD2y ago
would this be it? and if so, would you mind explaining what this is?
VIBEWOOD
VIBEWOOD2y ago
im so sorry about this i literally havent a clue how c# works