Skip to content

Commit fb829bd

Browse files
committed
Implement more parts of the Request class.
1 parent 8c65b15 commit fb829bd

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

lib/Cake/Network/Http/Request.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717

1818
/**
1919
* Implements methods for HTTP requests.
20+
*
21+
* Used by Cake\Network\Http\Client to contain request information
22+
* for making requests.
2023
*/
2124
class Request {
2225

@@ -46,6 +49,13 @@ class Request {
4649
'User-Agent' => 'CakePHP'
4750
];
4851

52+
/**
53+
* Get/Set the HTTP method.
54+
*
55+
* @param string|null $method The method for the request.
56+
* @return mixed Either this or the current method.
57+
* @throws Cake\Error\Exception On invalid methods.
58+
*/
4959
public function method($method = null) {
5060
if ($method === null) {
5161
return $this->_method;
@@ -58,6 +68,12 @@ public function method($method = null) {
5868
return $this;
5969
}
6070

71+
/**
72+
* Get/Set the url for the request.
73+
*
74+
* @param string|null $url The url for the request. Leave null for get
75+
* @return mixed Either $this or the url value.
76+
*/
6177
public function url($url = null) {
6278
if ($url === null) {
6379
return $this->_url;

0 commit comments

Comments
 (0)