Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我在 PHP 中使用 curl 时,我可以
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
这允许我将结果存储在一个变量中。
但是 C# 的libcURL没有返回传输选项。我可以在 c# 上使用什么来代替它?
我想等价物必须像这样编码,例如:
WebResponse webResponse = webRequest.GetResponse(); String response = null; using(var strReader = new StreamReader(webResponse.GetResponseStream())) { response = streamReader.ReadToEnd(); }