/** * Perform the requested upload. * @param string $file * @param string $type * @return array JSON **/ protected function uploadImage($data, $type = 'base64') { $post = Imgur::sendPOST(Imgur::$api_url . '/upload', array('image' => $data, 'type' => $type, 'name' => $this->name, 'title' => $this->title, 'caption' => $this->caption)); $json = json_decode($post, true); return $json; }