-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathuploadTask.php
More file actions
32 lines (25 loc) · 729 Bytes
/
Copy pathuploadTask.php
File metadata and controls
32 lines (25 loc) · 729 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
session_start();
include 'config.php';
$params = array(
'access_token' => $_SESSION['accessToken']
);
$task = array(
"content" => "this is an new task",
"_tasklistId" => "xxxxx"
);
$url = $api_domain . '/api/tasks?'.http_build_query($params);
// print_r($params);
$ch = curl_init();
$timeout = 5000;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($task));
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$result = curl_exec($ch);
curl_close($ch);
echo 'Result :' . $result . '<br /> <br />';
$jsonResult = json_decode($result);
?>