56 $this->consumer = $consumer;
58 $this->mediaType = $mediaType;
71 public function send($method, $parameters = array(), $body = null)
75 if (!empty($parameters)) {
76 if (strpos($url,
'?') ===
false) {
81 foreach ($parameters as $name => $value) {
82 $url .= $sep . urlencode($name) .
'=' . urlencode($value);
86 if (!$this->
unsigned) {
93 $http =
new HTTPMessage($url, $method, $body, $header);
95 if ($http->send() && !empty($http->response)) {
96 $http->responseJson = json_decode($http->response);
97 $http->ok = !is_null($http->responseJson);
Class to represent an HTTP message.