【问题标题】:Can we format JSON response in Android Network Profiler panel?我们可以在 Android Network Profiler 面板中格式化 JSON 响应吗?
【发布时间】:2018-12-26 06:46:22
【问题描述】:

我想在 Android Network Profiler 中获取格式化的 JSON 响应,而不是复制并粘贴到其他工具来格式化 JSON 响应。

Android Network Profiler 是检查网络流量的便捷工具。但我无法立即读取响应数据,因为我们的 JSON 数据显示在一行字符串中。

有没有办法在 Android Network Profiler 面板中获取格式化的 JSON 响应?

【问题讨论】:

  • 在浏览器中打开此链接:jsonviewer.stack.hu。现在复制单行响应并粘贴到 Json 查看器中。
  • @Ali 我不想复制粘贴。
  • 您想直接获得井格式吗? @HvSimon
  • @Ali 是的,Network Profiler 已经知道响应是内容类型的 JSON。为什么不直接格式化呢?

标签: android json android-studio android-profiler


【解决方案1】:

【讨论】:

  • 是的,但我找不到他为什么要格式化 JSON。我使用 Android Studio 3.2.1。也许他的 JSON 响应没有缩小,但我做到了?
【解决方案2】:

嗯,新版本的 Android Studio 3.3 在分析器中提供了新功能 View Parsed

它可以自动格式化响应。

更多信息见View formatted text for connection payloads in the Network profiler部分。

【讨论】:

    猜你喜欢
    • 2021-03-31
    • 1970-01-01
    • 2014-01-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-23
    • 1970-01-01
    相关资源
    最近更新 更多