Call between server connect actions

Hello dear wappler superstars !

I’ve always organized my server connect actions into back-end “functions” like :

And then called them from another action through the API step using the external ‘public’ URL of the action.

I’m wondering if there is a better way to call a server connect action from within another server connect action for better performances ? :slight_smile:

In the same spirit : Passing null values in POST variables of an API call seems to convert to empty strings on the receiving end. How do you handle those ?

Thank you for your help !

I do the same, although I use a variable for the host name so I can easily deploy to different sites.

https://{{$_SERVER['HTTP_HOST']}/path/to/file.php
1 Like

Smart, that answers another question I had in mind too, thank you for sharing ! :slight_smile:

I’ve found a more sophisticated way to do this… since my local wamp setup isn’t https and my production server is… and I’m going to be calling other server actions from all over the place…

I have a server action which runs on page load which sets a session variable s_api_base with the value:

{{$_SERVER['SERVER_PROTOCOL'].split("/")[0]}}://{{$_SERVER['HTTP_HOST']}}/dmxConnect/api/

Then I can just use:

{{$_SESSION.s_api_base}}my_folder/server_action.php
1 Like