I would like so send post parameter via curl. I tried this:
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(
array(
"content" => "Hi",
"message_type" => "outgoing",
"content_type" => "input_select",
"content_attributes" => '{ "items": [{ "title": "Option1", "value": "Option 1" }, { "title": "Option2", "value": "Option 2" }]}',
"private" => false
)
));
But this way does not work. If works like this:
curl_setopt($ch, CURLOPT_POSTFIELDS,
'{
"content": "Hi",
"message_type" : "outgoing",
"content_type": "input_select",
"content_attributes": {
"items": [
{ "title": "Option1", "value": "Option1" },
{ "title": "Option2", "value": "Option2" }
]
},
"private":false
}'
);
Would it be also possible to do it like the way with array (my first try). If yes, where is my mistake?