Encode array into url for curl

I’m working with a Wordpress site that uses a form plugin to fire a hook.

I need a simple curl call that will encode a couple of fields from the form into the url.

The form passes all of the form fields in an array. I need to tweeze out certain fields, eventually, because I only need a couple of the fields in the curl call.

I am playing with this now in pipedream, and I have verified that the hook is getting called, and curl calls are making it to the pipedream.

What I want to do, for now, is just encode this entire array into to the url into a string, and then when I figure out which fields I need from it, tweeze out those fields.

So far, what I have is below. $request is the entire array of fields.


function twilio_verification_flow( $request )

    $url = 'https:://mypipedream.pipedream.net';

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL,$url);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION,true);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);

    curl_setopt($ch, CURLOPT_POST,true);

    $resp = curl_exec($ch);
    return json_decode($resp,true);
add_action('jet-form-builder/custom-action/twilio_verification_flow', $request);
add_action('jet-form-builder/custom-action/twilio_verification_flow', 'twilio_verification_flow', 1);


setup is telling curl to use POST, not GET, so it’s not expecting form data in the URL, it’s expecting it in the POST payload.