SimWhite Posted April 23, 2014 Report Posted April 23, 2014 Hello, I have some questions about universal module. Does it have only POST requests to an API or I can user GET requests too? And what about of using different variables at requests? Quote
0 Paul Posted May 6, 2014 Report Posted May 6, 2014 Currently the Universal Module can currently only do POST requests to an external URL. We have plans to make this more robust in the future. Michael 1 Quote
0 SimWhite Posted May 7, 2014 Author Report Posted May 7, 2014 And what about variables? Can I pre-define some and use it at POST requests? Quote
0 Paul Posted May 7, 2014 Report Posted May 7, 2014 And what about variables? Can I pre-define some and use it at POST requests? Yes, the "Name" that you enter for the fields are passed in the POST request. Label is the name that is displayed, like "Domain Name" and Name is the field name, which could be something like "domain_name". I believe this is a multi-dimensional array however, so you should capture it in your API file using something like. $response = print_r($_POST, true); file_put_contents("/path/to/file.txt", $response); My PHP is rusty, but I think that would work. Make sure file.txt exists and is writable, and after the POST request is made, open the file and see what the array looks like and you'll know where to pull your data from. Quote
Question
SimWhite
Hello, I have some questions about universal module. Does it have only POST requests to an API or I can user GET requests too? And what about of using different variables at requests?
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.