Skip to content

Commit

Permalink
Querystring on URL
Browse files Browse the repository at this point in the history
  • Loading branch information
bajb committed Jan 11, 2016
1 parent 02d9d6f commit 014168f
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/ApiRequestDetail.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,25 @@ class ApiRequestDetail implements IApiRequestDetail
*/
public function getUrl()
{
return $this->_url;
if(empty($this->_query))
{
return $this->_url;
}

if(substr($this->_url, -1, 1) == '?')
{
$glue = '';
}
else if(stristr($this->_url, '?'))
{
$glue = '&';
}
else
{
$glue = '?';
}

return $this->_url . $glue . http_build_query($this->_query);
}

/**
Expand Down

0 comments on commit 014168f

Please sign in to comment.