title: WSO2 AM HTTP Endpoint rewrite url
body: <p>I am trying to implement WSO2 API Manager to handle calls to an API endpoint and do some mediation on the response. I have added an API in the publisher, set a http endpoint to the remote API and implemented some mediators. Everything is working just fine.
  I have the following mapping:
  {context}/{version}/RetrieveResource/{resourceid} -> {api server}/RetrieveResource/{resourceid}</p>
  
  <p>Now I want to change the mapping like so:
  {context}/{version}/Resource/{resourceid} -> {api server}/RetrieveResource/{resourceid}</p>
  
  <p>So I would like that my WSO2 api has the path /Resource/1 that calls the remote api /RetrieveResource/1. Therefore I have tried to use a rewrite mediator in my in-sequence. This changes my "To" header, but does not call the right endpoint path. I call Resource/1, I mediate it to RetrieveResource/1, but WSO2 still calls the endpoint as Resource/1 which ofcourse gives me a 404.</p>
  
  <p>My mediator looks as follows:</p>
  
  <pre><code>&lt;sequence xmlns="http://ws.apache.org/ns/synapse" name="custom_in"&gt;
      &lt;property name="WSO2_AM_API_ACCEPT_MESSAGE_TYPE" expression="get-property('transport', 'Accept')" scope="default"/&gt;
      &lt;property name="Accept" scope="transport" action="remove"/&gt;
  
      &lt;rewrite xmlns="http://ws.apache.org/ns/synapse"&gt;
          &lt;rewriterule&gt;
              &lt;action value="RetrieveResource" regex="Resource" type="replace" fragment="path"/&gt;
          &lt;/rewriterule&gt;
      &lt;/rewrite&gt;
  
  &lt;/sequence&gt;
  </code></pre>
  
  <p>I am clearly missing something, any help would be greatly appreciated.</p>