<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>231875</bug_id>
          
          <creation_ts>2021-10-16 21:12:45 -0700</creation_ts>
          <short_desc>Web Inspector: The &quot;Network&quot; tab doesn&apos;t show the bodies of AJAX requests sent with a Blob</short_desc>
          <delta_ts>2021-10-23 21:13:16 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Inspector</component>
          <version>Safari 15</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>finesserus</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>inspector-bugzilla-changes</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1805350</commentid>
    <comment_count>0</comment_count>
    <who name="">finesserus</who>
    <bug_when>2021-10-16 21:12:45 -0700</bug_when>
    <thetext>The &quot;Network&quot; tab of the Safari&apos;s Web Inspector doesn&apos;t show the bodies of AJAX requests sent with a Blob. It makes it harder to use Safari for a website development, because it&apos;s impossible to see request bodies.

To reproduce, open any website in Safari and run these commands in the browser console:

    fetch(&apos;/test&apos;, {method: &apos;post&apos;, body: new Blob([&apos;{&quot;foo&quot;:&quot;bar&quot;}&apos;], {type: &apos;application/json&apos;})});
    var req = new XMLHttpRequest(); req.open(&apos;post&apos;, &apos;/test&apos;, true); req.send(new Blob([&apos;{&quot;foo&quot;:&quot;bar&quot;}&apos;], {type: &apos;application/json&apos;}));

Then open the &quot;Network&quot; tab, open a request produced by these commands and try to find the request body. The request body is not shown. I expect to see the request body at the very bottom of the &quot;Headers&quot; section and in the &quot;Preview&quot; section (after selecting &quot;Request&quot; in the top right corner).

The following commands produce absolutely the same requests, but their bodies are visible in the Web Inspector:

    fetch(&apos;/test&apos;, {method: &apos;post&apos;, headers: {&apos;Content-Type&apos;: &apos;application/json&apos;}, body: &apos;{&quot;foo&quot;:&quot;bar&quot;}&apos;});
    fetch(&apos;/test&apos;, {method: &apos;post&apos;, headers: {&apos;Content-Type&apos;: &apos;application/json&apos;}, body: new TextEncoder().encode(&apos;{&quot;foo&quot;:&quot;bar&quot;}&apos;)});
    var req = new XMLHttpRequest(); req.open(&apos;post&apos;, &apos;/test&apos;, true); req.setRequestHeader(&apos;Content-Type&apos;, &apos;application/json&apos;); req.send(&apos;{&quot;foo&quot;:&quot;bar&quot;}&apos;);
    var req = new XMLHttpRequest(); req.open(&apos;post&apos;, &apos;/test&apos;, true); req.setRequestHeader(&apos;Content-Type&apos;, &apos;application/json&apos;); req.send(new TextEncoder().encode(&apos;{&quot;foo&quot;:&quot;bar&quot;}&apos;));

Web Inspector shows bodies sent with Uint8Array, so I suppose it&apos;s possible to display Blob requests too.

I can reproduce it in macOS Safari 15.0, macOS Safari TP 15.4, iOS Safari 13.1.2 and iOS Safari 15.1. I didn&apos;t check in other conditions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1808168</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-10-23 21:13:16 -0700</bug_when>
    <thetext>&lt;rdar://problem/84585984&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>