-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathexample.php
More file actions
38 lines (33 loc) · 1.26 KB
/
example.php
File metadata and controls
38 lines (33 loc) · 1.26 KB
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
33
34
35
36
37
38
<?php
// dummy example of RestClient
require_once('include/untis/CommonUtils.php');
require_once('include/RestClient.class.php');
$enteredUsername = "demo@c3crm.cn";//test account
$enteredPassword = "demo";
$paras = array();
//$paras["callback"] = "?";
$paras["method"] = "login";
$paras["input_type"] = "JSON";
$paras["response_type"] = "JSON";
$json = getJSONObj();
$paras["rest_data"] = $json->encode(array(array("password"=>$enteredPassword,"user_name"=>$enteredUsername),"C3CRM",array("name"=>"language","value"=>"en_US")));
$twitter = RestClient::post('http://crm123.sinaapp.com/rest.php',$paras);
//$twitter = RestClient::post( // Same for RestClient::get()
// 'http://crm123.sinaapp.com/rest.php?callback=?'
// ,'{
// method: "login",
// input_type: "JSON",
// response_type: "JSON",
// rest_data: \'[{"password":"'.$enteredPassword.'","user_name":"'.$enteredUsername.'"},"C3CRM",{"name":"language","value":"en_US"}]\'
// }'
// ,''
// ,''
// ,'application/json');
var_dump($twitter->getResponse());
echo "<br>aaaaaaaaaaaa<br>";
var_dump($twitter->getResponseCode());
echo "<br>bbbbbbbbbbb<br>";
var_dump($twitter->getResponseMessage());
echo "<br>cccccccccccc<br>";
var_dump($twitter->getResponseContentType());
?>