Proxy some api calls to a third party in rails-api
<p>I have a collection of API endpoints. One of the endpoints is supposed to load some content from another server. I'm using rails-api for the API server. </p>

<p>Essentially the api call needs to do the following:</p>

<pre><code>api_call --&gt; api_server --&gt; GET thirdparty_server.com
</code></pre>

<p>the api_server then needs to return whatever is provided by thirdparty_server.com. Is this doable in rails? Essentially, we don't want the thirdparty_server accessible to anything else except the rails api.</p>

<p>We want the content from thirdparty_server.com to be loaded into an iframe on the client side.To give more context:</p>

<pre><code>iframe           --&gt; api             --&gt; thirdparty --&gt; api --&gt; iframe
src="api_call_url"   GET thidparty_url   Resp       --&gt; Resp--&gt; Resp
</code></pre>