/** * set http body content */ private static function setContent($options) { if (self::$method) { self::$content = array(); foreach ($options as $key => $val) { if ($key != "image") { self::$content[$key] = sprintf("%s", $val); } else { self::$content[$key] = "@" . realpath("./{$val}"); } } } else { foreach ($options as $key => $val) { self::$content .= $key . "=" . urlencode($val) . "&"; } } }