.NET WebClient.UploadValues vs WebClient.UploadData

后端 未结 1 1727
庸人自扰
庸人自扰 2021-01-12 08:06

I am writing a class library to perform operations on a site outside my control. The site is accepting form-posts as input.

Can anyone tell me if there is a differen

相关标签:
1条回答
  • 2021-01-12 08:32

    Both "POST" the data to the server. If you use UploadValues, the values will be made available to the server in the Request.Form collection which is how a normal HTML form works. UploadData gives you more flexibility since no escaping is performed on your data. Its up to you to format the data in a way that the server will understand. As a consequence of this, you can use UploadData to duplicate the behavior of UploadValues.

    0 讨论(0)
提交回复
热议问题