blob: b1cd6421ab7a619dc98707904ff37561bfc9b187 (
plain)
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
|
<?php
/**
* PCurl is a REST client libary for PHP.
*
* See http://github.com/purplecode/php.curl for details.
*
* This code is licensed for use, modification, and distribution
* under the terms of the MIT License (see http://en.wikipedia.org/wiki/MIT_License)
*/
namespace PurpleCode\PCurl;
class PJsonCurl extends PCurl {
public function __construct($host) {
parent::__construct($host);
$this->contentTypeJson();
}
public function call($method, $url, $payload = '') {
return json_decode(parent::call($method, $url, json_encode($payload)));
}
}
|