1👍
✅
What i finally did was using a string instead of php assoicative array
$ch = curl_init();
$curlConfig = array(
CURLOPT_URL => "http://url",
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => "name=name1&emailname1@email&name=name2&email=name2@email"
);
curl_setopt_array($ch, $curlConfig);
$result = curl_exec($ch);
print $result;
curl_close($ch);
1👍
In PHP, array keys must be unique. The second ‘name’ overwrites the data in the first ‘name’ so you would need a slightly different scheme.
- [Answered ]-Django rest update (and partial_update) after retrieve action
- [Answered ]-Django admin datetime `now` button picking correct local time, but wrong server time
- [Answered ]-Is there a way to specify abstract functions which take in values for __init__
- [Answered ]-Django no reverse match error but i have optional view parameters
0👍
You might be able to use something like this. Do you have a way to make a dump of the data in the Django script?
CURLOPT_POSTFIELDS => array(
array(
'name' => 'name1',
'email' => 'name1@email',
),
array(
'name' => 'name2',
'email' => 'name2@email',
)
)
- [Answered ]-Webpack: "Uncaught SyntaxError: Unexpected token <" in Django
- [Answered ]-Django+gunicorn+nginx 404 serving static files
- [Answered ]-How can I embed two fields together in serializer
Source:stackexchange.com