Forums

cURL response processing

johnagr 17 Jun, 2013
I am currently using the cURL [GH] action to call a remote API. The functionality works as expected; what I want to do however is have an action that either a)presents the user with a welcome page or b)returns an error message (depending on the success of the post). I have enabled the CURLOPT_RETURNTRANSFER option and can see the message that gets returned on error. How do I do anything useful with this message. Is it stored in a variable that I can use? I cannot find any documentation online which shows me how to do it.
johnagr 17 Jun, 2013
OK, I found the answer to this. I had to make sure CURLOPT_RETURNTRANSFER was NOT an option in the cURL action. Then reference $form->data['curl_gh'] in following custom code actions.
GreyHead 19 Jun, 2013
Hi sofiaanar,

Well found, I wouldn't have know that without doing the research.

Bob
This topic is locked and no more replies can be posted.