1

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.

4

1 回答 1

0

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

var body = await e.GetRequestBodyAsString();
于 2021-11-03T07:16:56.357 回答