Search code examples
jsongoogle-chromehttp-postgoogle-chrome-devtoolspayload

How to convert Chrome's Request Payload into JSON?


When I'm checking web requests in Chrome's DevTools on Mac (Network tab), I've got the Payload in the following format:

7|0|6|https://www.example.com/app/Basic/|00D1D071AC218DFE91521C012683E911|com.optionfair.client.common.services.nongenerated.RefreshService|getCometUpdates|I|J|1|2|3|4|3|5|6|6|173|VvAwAqy|o$UN|

which is basically separated by vertical bar character (|).

How I can copy or convert above payload from Chrome into some meaningful format such as JSON? Any ideas?

Chrome's DevTools, Network tab, Request Payload, Headers

Btw. In this question it looks fine on the screenshot, but in my case, I don't have view parsed and it doesn't look like JSON format at all.


Using Google Chrome on Mac (Version 57.0.2987.133, 64-bit).


Reproducible steps:

  1. Go to this page.
  2. Open DevTools on Network/XHR tab and look for refresh requests.

My goal is to reuse/replicate the POST data in Request Payload in the command-line tool such as curl so it can be recognized (not necessary on the page mentioned above, but I'd like to know the general approach to deal with this blob format). I would expect JSON format, but it's not.


Solution

  • Here you need to look at the request header content-type to determine how this request was encoded before knowing what might parse it:

    request headers

    This is GWT RPC, so it can include serializations of built-in and custom Java Objects, where knowledge of the class is in both server-side Java and transpiled Java running on the client via Google Web Toolkit.

    There is no reason for Chrome to understand this format directly, and it need not have a JSON or XML cannonicalization. Fully interpreting these calls to the extent it is possible on the client may require disassembly or introspection tricks against the transpiled client code, assuming the program wasn't transpiled with source maps.

    Without digging into the client code, one can interpret the literal rpc while guessing at or probing the definition of classes and their methods by modifying the call.