❔ Web Request
I have a code like the one in the picture and this code is going well, but the response is not getting the result I want, why?
142 Replies
god, please use
HttpClient
Netcore 3.0
Use UTF8 encoding
Yeah
HttpClient
is available since Framework 4.5why
I tried utf 8, it didn't work
Because it supports a wider range of characters and trying to encode higher encoded characters into ascii is going to cause malformations
@🌈 Thinker 🌈 httpclient add header?
wdym?
what
send code
i tried and it didn't work
Encoding.UTF8.GetString(responseArray, 0, responseArray.Length)
@🌈 Thinker 🌈 @Nax
why error await?
What does the error say?
@🌈 Thinker 🌈 The 'await' operator can only be used inside an async method. Consider marking this method with the 'async' modifier and changing its return type to 'Task<int>'
Yeah, so do what it says
?
:DDDD
Consider marking this method with the 'async' modifier and changing its return type to 'Task<int>'
Asynchronous programming in C#
An overview of the C# language support for asynchronous programming using async, await, Task, and Task
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
@TeBeClone
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
upgraded net core 5.1
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
wht
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
Huh...?
SORRY
5.0
.NET 5?
+
Okay.
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
^
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
@TeBeClone Why is the result like this?
Use .NET 8 :)
.
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
no encode
Which decoding are you using?
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
$code
To post C# code type the following:
```cs
// code here
```
Get an example by typing
$codegif
in chat
If your code is too long, post it to: https://paste.mod.gg/Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
no no
send
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
Why do people insist on sending screenshots over code snippets?
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
:)
I do the same.
sended
@TeBeClone
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
You're still using ASCIIEncoding.
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
Switch to .NET 7.
Switch to HttpClient & UTF-8.
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
$mains
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
The possible signatures for
Main
are public
is not required (can be any accessibility).
Top-level statements are compiled into a Main
method and will use an appropriate signature depending on the body.
https://docs.microsoft.com/en-US/dotnet/csharp/fundamentals/program-structure/main-command-lineMain() and command-line arguments
Learn about Main() and command-line arguments. The 'Main' method is the entry point of an executable program.
httpclient
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
I usually create another main.
MainAsync.
the result is bad
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
What?
HttpClient is much better than WebClient.
the result is wrong, there is no problem with other codes
I like HttpFactory.
You're doing it wrong.
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
HTTP CLIENT ALREADY
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
I'm so confused, is there any chance you could throw it away?
What?
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
@TeBeClone @Azrael
:(
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
We're here, you don't need to ping us.
okey
sorryt
sorry bro
Once again, you have to post the code snippet.
$code
To post C# code type the following:
```cs
// code here
```
Get an example by typing
$codegif
in chat
If your code is too long, post it to: https://paste.mod.gg/I lost my mind.
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
...
That's GZIP and DEFLATE.
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
what
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
If it's compressed it won't be readable.
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
🤷♂️
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
Don't get me wrong, I just wrote it to correct why the result was wrong.
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
THANKS
THANKS
THANKS
LOVE
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
a little mistake i'm so sorry i took your time thank you
yes
friend
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
Lol.
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
@TeBeClone game client
You can't just print out GZIP data and expect a raw string correctly encoded.
I'm building a client map or something to upload special models to players.
Thanks @Azrael @TeBeClone
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
Okay.
You're still doing a lot of things incorrectly.
why
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
^
what
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
He's emulating an interactive session lol.
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
Yes.
Which won't work.
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
Most likely not.
Automating such a thing violates most TOSs.
thanks @Azrael @TeBeClone
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
Please...
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
yes account information get
You're also hard coding paths, headers, agents and stuff.
@Azrael @TeBeClone 571aee97d861e11cf938092ca612da9ee06d077a what hashe does this look like
...
Probably SHA-1?
idk
session id
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
Yes.
Doesn't sound "TOS following".
okey okye
s
close
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
na
friend
doğukan üçkardeş(Hera)
real name
instagram dogukanückardes
add
Why'd you say his name?
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
I did not do anything
@TeBeClone
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
okey oeky
sorry
bro
Did Hera answer?
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
Reasonable.
thanks
@TeBeClone delete channel please
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.