Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 通过webview c发送http post请求#_C#_.net_Webview - Fatal编程技术网

C# 通过webview c发送http post请求#

C# 通过webview c发送http post请求#,c#,.net,webview,C#,.net,Webview,我正在处理一个从webview检索JSessionId的案例。我尝试了几种张贴在这里的解决方案,但都不起作用。现在,我正在寻找一种方法来调用RESTAPI请求,创建一个新会话,并从该会话中检索Jsession。我需要保持webview打开,以避免丢失cookies和会话,但我不知道是否有方法通过webview调用http请求 我试图获取jsessionid,但却收到null: 公共静态字符串GetCookie(字符串url) { int size=512; StringBuilder sb=新的

我正在处理一个从webview检索JSessionId的案例。我尝试了几种张贴在这里的解决方案,但都不起作用。现在,我正在寻找一种方法来调用RESTAPI请求,创建一个新会话,并从该会话中检索Jsession。我需要保持webview打开,以避免丢失cookies和会话,但我不知道是否有方法通过webview调用http请求

我试图获取jsessionid,但却收到null:

公共静态字符串GetCookie(字符串url)
{
int size=512;
StringBuilder sb=新的StringBuilder(尺寸);
如果(!InternetGetCookieEx(url,
null,sb,ref size,INTERNET(仅限于http,IntPtr.Zero))
{
如果(尺寸<0)
{
返回null;
}
sb=新的StringBuilder(尺寸);
如果(!InternetGetCookieEx(url,
null,sb,ref size,INTERNET(仅限于http,IntPtr.Zero))
{
返回null;
}
}
使某人返回字符串();
}