var settings = {
"async": true,
"crossDomain": true,
"url": "YOUR_BULLIT_URL",
"method": "POST",
"headers": {
"content-type": "application/x-www-form-urlencoded"
},
"data": {
"api_key": "YOUR_API_KEY",
"text": "Test POST jquery pour Metromix",
"name": "team-a",
"type": "Team A",
"room": "YOUR_ROOM"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
curl -X POST \
YOUR_BULLIT_URL \
-H 'content-type: application/x-www-form-urlencoded' \
-d 'api_key=YOUR_API_KEY&text=Ceci%20est%20un%20test&name=metromix&type=MetromixAPI&room=YOUR_ROOM'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "YOUR_BULLIT_URL",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "api_key=YOUR_API_KEY&text=Ceci%20est%20un%20test%20PHP%20cURL&name=metromix&type=MetromixAPI&room=YOUR_ROOM",
CURLOPT_HTTPHEADER => array(
"content-type: application/x-www-form-urlencoded"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}