WebClient, what does UploadString do?

What does WebClient.UploadString do?

I thought it was a message, so I can log in with it. When I used wc.UploadString (@ " http://mysite.com/login ", "user = u & pass = p"); I thought we get html on the first page with my input. However, all that I received was not a warning that my pass was incorrect, and my method=postnote is below.

What does WebClient.UploadString really do? and how can I log in using WebClient?

+3
source share
2 answers

To enter, you should probably use WebClient.UploadValues , as described here .

+3
source

The second parameter is the transfer of data to the message body. You formatted it as part of the request. If the username / password is indeed passed in the query string, they must be included in the first parameter (url). Otherwise, more likely, if they are submitted as form parameters, then use UploadValues, as suggested by Andrey.

+1
source

Source: https://habr.com/ru/post/1754690/


All Articles