How to use WebRequest to POST some data and read response?
问题 Need to have the server make a POST to an API, how do I add POST values to a WebRequest object and how do I send it and get the response (it will be a string) out? I need to POST TWO values, and sometimes more, I see in these examples where it says string postData = "a string to post"; but how do I let the thing I am POSTing to know that there is multiple form values? 回答1: From MSDN // Create a request using a URL that can receive a post. WebRequest request = WebRequest.Create ("http:/