Hi,
how can I create a linebreak in my php curl API call?
$header = array(
"Authorization: Token $token",
"Content-Type: application/json"
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_url . 'discussions');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,
json_encode((array (
'data' =>
array (
'type' => 'discussions',
'attributes' =>
array (
'title' => 'test',
'content' => 'test \r\n test',
),
'relationships' =>
array (
'tags' =>
array (
'data' =>
array (
0 =>
array (
'type' => 'tags',
'id' => $default_tagID,
),
),
),
),
),
))));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1); // On dev server only!
$result = curl_exec($ch);
print_r($result);
curl_close($ch);