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.

John DeBritto
  • 141
  • 3
  • 12

1 Answers1

0

In order to get the payload you should await it

var body = await e.GetRequestBodyAsString();
ggeorge
  • 1,496
  • 2
  • 13
  • 19