Client call external REST API

Hi - I am trying to create a simple form that will POST onto a server I have running in AWS.

Would the client make the call directly to this server or should it go through the Anvil server?

My AWS only supports whitelisting of external IP addresses. How do I get the whitelist of where my code is calling from? Would it just be my local machine?

Hello @mbecker,

Would the client make the call directly to this server or should it go through the Anvil server?

This is completely up to you. You can make requests from the client or the server.

How do I get the whitelist of where my code is calling from?

If you send the request from a server module it will be one of Anvil’s server IP addresses. Please email support@anvil.works to get our current list of egress IP addresses.

Would it just be my local machine?

If you send the request from client code, the IP address will be that of your local machines.

1 Like

Thanks Ryan. I changed it to use the server side as I was running into cross platform issues. Got the public IP by querying to webhook site which returns the requestor. So all good now. Thanks for getting back to me!

1 Like