简体   繁体   中英

How to get request payload using Titanium Web Proxy in C#?

I'm using Titanium Web proxy to monitor requests and responses but I can't find out how get the payload data of requests. Here is my function that takes the request object and pulls the data I need from it.

    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);
    }

I'm able to pull and save the body, method type, headers, and url but I don't know how to get the payload data being sent out like when I'm logging into an account and submit the login form. Any and all help is appreciated, Thanks.

为了获得有效载荷,您应该等待它

var body = await e.GetRequestBodyAsString();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM