Sending HTTP POST with System.Net.WebClient

后端 未结 3 1804
自闭症患者
自闭症患者 2020-12-05 02:39

Is it possible to send HTTP POST with some form data with System.Net.WebClient?

If not, is there another library like WebClient that can do HTTP POST? I know I can u

3条回答
  •  余生分开走
    2020-12-05 02:50

    WebClient doesn't have a direct support for form data, but you can send a HTTP post by using the UploadString method:

    Using client as new WebClient
        result = client.UploadString(someurl, "param1=somevalue¶m2=othervalue")
    End Using
    

提交回复
热议问题