Skip to content

Commit

Permalink
Implement more parts of the Request class.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Dec 21, 2012
1 parent 8c65b15 commit fb829bd
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/Cake/Network/Http/Request.php
Expand Up @@ -17,6 +17,9 @@

/**
* Implements methods for HTTP requests.
*
* Used by Cake\Network\Http\Client to contain request information
* for making requests.
*/
class Request {

Expand Down Expand Up @@ -46,6 +49,13 @@ class Request {
'User-Agent' => 'CakePHP'
];

/**
* Get/Set the HTTP method.
*
* @param string|null $method The method for the request.
* @return mixed Either this or the current method.
* @throws Cake\Error\Exception On invalid methods.
*/
public function method($method = null) {
if ($method === null) {
return $this->_method;
Expand All @@ -58,6 +68,12 @@ public function method($method = null) {
return $this;
}

/**
* Get/Set the url for the request.
*
* @param string|null $url The url for the request. Leave null for get
* @return mixed Either $this or the url value.
*/
public function url($url = null) {
if ($url === null) {
return $this->_url;
Expand Down

0 comments on commit fb829bd

Please sign in to comment.