Changeset View
Changeset View
Standalone View
Standalone View
src/future/http/HTTPFuture.php
Show First 20 Lines • Show All 238 Lines • ▼ Show 20 Lines | private function buildHTTPRequest() { | ||||
$data = $this->getData(); | $data = $this->getData(); | ||||
$method = $this->getMethod(); | $method = $this->getMethod(); | ||||
$uri = $this->fullRequestPath; | $uri = $this->fullRequestPath; | ||||
$add_headers = array(); | $add_headers = array(); | ||||
if ($this->getMethod() == 'GET') { | if ($this->getMethod() == 'GET') { | ||||
if (is_array($data)) { | if (is_array($data)) { | ||||
$data = http_build_query($data, '', '&'); | $data = phutil_build_http_querystring($data); | ||||
if (strpos($uri, '?') !== false) { | if (strpos($uri, '?') !== false) { | ||||
$uri .= '&'.$data; | $uri .= '&'.$data; | ||||
} else { | } else { | ||||
$uri .= '?'.$data; | $uri .= '?'.$data; | ||||
} | } | ||||
$data = ''; | $data = ''; | ||||
} | } | ||||
} else { | } else { | ||||
if (is_array($data)) { | if (is_array($data)) { | ||||
$data = http_build_query($data, '', '&')."\r\n"; | $data = phutil_build_http_querystring($data)."\r\n"; | ||||
$add_headers[] = array( | $add_headers[] = array( | ||||
'Content-Type', | 'Content-Type', | ||||
'application/x-www-form-urlencoded', | 'application/x-www-form-urlencoded', | ||||
); | ); | ||||
} | } | ||||
} | } | ||||
$length = strlen($data); | $length = strlen($data); | ||||
Show All 37 Lines |