Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/298.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#中使用Tianium Web代理获取请求负载?_C#_Web Scraping_Proxy_Request_Titanium Web Proxy - Fatal编程技术网

如何在C#中使用Tianium Web代理获取请求负载?

如何在C#中使用Tianium Web代理获取请求负载?,c#,web-scraping,proxy,request,titanium-web-proxy,C#,Web Scraping,Proxy,Request,Titanium Web Proxy,我正在使用Tianium Web proxy来监视请求和响应,但我不知道如何获取请求的有效负载数据。下面是我的函数,它获取请求对象并从中提取我需要的数据 public async Task OnRequest(object sender, SessionEventArgs e) { string requestBodySent = e.HttpClient.Request.HasBody ? e.HttpClient.Request.BodyString : nu

我正在使用Tianium Web proxy来监视请求和响应,但我不知道如何获取请求的有效负载数据。下面是我的函数,它获取请求对象并从中提取我需要的数据

    public async Task OnRequest(object sender, SessionEventArgs e)
    {
        string requestBodySent = e.HttpClient.Request.HasBody ? e.HttpClient.Request.BodyString : null;
        CustomRequests requestSent = new CustomRequests(e.HttpClient.Request.Method, e.HttpClient.Request.HeaderText, requestBodySent, e.HttpClient.Request.RequestUri);

        requestHistory.Add(requestSent);
    }
我能够提取并保存正文、方法类型、标题和url,但我不知道如何获取发送的有效负载数据,就像我登录帐户并提交登录表单时一样。非常感谢您的帮助,谢谢