title: Cypress intercept identical request based on request body
body: <p>In my app, I have a flow that triggers two POST requests to the same endpoints but with a slightly changed request body. How can we achieve this with cypress?</p>
  <p><strong>Request 1:</strong>
  Request URL: <code>http://localhost:8000/weather/F20210908060000/spot</code></p>
  <p>Request Method: <code>POST</code></p>
  <p>Request body:</p>
  <pre><code>{
    &quot;locations&quot;: [
      {
        &quot;timestamp&quot;: &quot;2021-09-18T06:00:00.000Z&quot;,
        &quot;coordinates&quot;: [
          106.41364531249987,
          -15.435157996299878
        ]
      },
      {
        &quot;timestamp&quot;: &quot;2021-09-18T07:00:00.000Z&quot;,
        &quot;coordinates&quot;: [
          106.41364531249987,
          -15.435157996299878
        ]
      }
    ],
    &quot;elements&quot;: [
      2
    ]
  }
  </code></pre>
  <p><strong>Request 2:</strong>
  Request URL:</p>
  <pre><code>http://localhost:8000/weather/F20210908060000/spot
  </code></pre>
  <p>Request Method: <code>POST</code></p>
  <p>Request body:</p>
  <pre><code>{
    &quot;locations&quot;: [
          {
        &quot;timestamp&quot;: &quot;2021-09-18T04:00:00.000Z&quot;,
        &quot;coordinates&quot;: [
          106.41364531249987,
          -15.435157996299878
        ]
      },
      {
        &quot;timestamp&quot;: &quot;2021-09-18T05:00:00.000Z&quot;,
        &quot;coordinates&quot;: [
          106.41364531249987,
          -15.435157996299878
        ]
      },
  {
        &quot;timestamp&quot;: &quot;2021-09-18T06:00:00.000Z&quot;,
        &quot;coordinates&quot;: [
          106.41364531249987,
          -15.435157996299878
        ]
      },
      {
        &quot;timestamp&quot;: &quot;2021-09-18T07:00:00.000Z&quot;,
        &quot;coordinates&quot;: [
          106.41364531249987,
          -15.435157996299878
        ]
      }
    ],
    &quot;elements&quot;: [
      2
    ]
  }
  </code></pre>
  <p>Note: Request 2 has more data in its request.</p>
  <p><strong>My code so far:</strong></p>
  <pre><code> cy.intercept(&quot;POST&quot;, &quot;**/spot&quot;, (req) =&gt; {
          expect(req.locations).to.have.length.above(3);
      }).as('postSPOT1');
      Weather.activateSPOTWeather()
   });
   cy.wait('@postSPOT1').its('response.statusCode').should(&quot;eq&quot;, 200);
  </code></pre>
  <p><a href="https://i.stack.imgur.com/FzXYe.png" rel="noreferrer"><img src="https://i.stack.imgur.com/FzXYe.png" alt="enter image description here" /></a></p>