i'm trying to create a method for an http request using this code, but it only picks up 1 set of key and value pair ("key_1"=>"value_1"). how do i get all the array keys and their values?
<?php $userPostData = [ 'key_1' => "value_1", 'key_2' => "value_2" ]; foreach($userPostData as $key => $value) { $response = $client->post($apiUrl, [ 'json' => [ $key => urlencode($value), ], 'verify' => false ]); }