title: How to rewrite both GET and POST to the same endpoint with different response bodies?
body: <p>I need to rewrite with <a href="https://www.charlesproxy.com/" rel="nofollow noreferrer">Charles Proxy</a>, with both GET and POST to the same endpoint expecting different response bodies, i.e.:</p>
  
  <p><code>GET</code> to <code>endpoint</code> should return <code>body1</code></p>
  
  <p>while</p>
  
  <p><code>POST</code> to <code>endpoint</code> should return <code>body2</code></p>
  
  <p>What I see in Charles' rewrite setting is that there is no differentiation between http method so Charles can't know which one I'm referring to.</p>
  
  <p>My (kinda hack-workaround) solution would be to make my application to use endpoint1 for GET and endpoint2 for POST. Charles' setting would be then:</p>
  
  <p><code>GET</code> to <code>endpoint1</code> should return <code>body1</code></p>
  
  <p><code>POST</code> to <code>endpoint2</code> should return <code>body2</code></p>
  
  <p>In this way I'm able to have 2 separate rules. But I think this solution is not elegant.</p>