我将尝试解释如何使用CefSharp直接向URL发送POST数据。
以下是我要发送的示例:
var values = new Dictionary<string, string>
{
{ "thing1", "hello" },
{ "thing2", "world" }
};
FormUrlEncodedContent content = new FormUrlEncodedContent(values);
我希望将以下内容作为POST数据发送到http://example.com/mydata.php
,数据内容为thing1=hello&thing2=world
,并使用已有的cefsharp浏览器进行操作。
据我所见:
browser.Load("http://example.com/mydata.php");
无法附加POST数据,有没有其他方法可以实现呢?
基本上我需要保留浏览器已经有的相同cookie,因此如果有另一种方法可以使用HttpWebRequest和cefsharp ChromiumWebBrowser cookie一起使用,然后再次同步该请求,那也可以,但我不确定是否可能。