Skip to content

Commit 6785514

Browse files
committed
Consistently use $body argument name for request body
1 parent bf32f16 commit 6785514

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,10 @@ offers several methods that resemble the HTTP protocol methods:
123123
```php
124124
$browser->get($url, array $headers = array());
125125
$browser->head($url, array $headers = array());
126-
$browser->post($url, array $headers = array(), string|ReadableStreamInterface $contents = '');
127-
$browser->delete($url, array $headers = array(), string|ReadableStreamInterface $contents = '');
128-
$browser->put($url, array $headers = array(), string|ReadableStreamInterface $contents = '');
129-
$browser->patch($url, array $headers = array(), string|ReadableStreamInterface $contents = '');
126+
$browser->post($url, array $headers = array(), string|ReadableStreamInterface $body = '');
127+
$browser->delete($url, array $headers = array(), string|ReadableStreamInterface $body = '');
128+
$browser->put($url, array $headers = array(), string|ReadableStreamInterface $body = '');
129+
$browser->patch($url, array $headers = array(), string|ReadableStreamInterface $body = '');
130130
```
131131

132132
Each of these methods requires a `$url` and some optional parameters to send an
@@ -1921,7 +1921,7 @@ See also [GET request client example](examples/01-client-get-request.php).
19211921

19221922
#### post()
19231923

1924-
The `post(string $url, array $headers = array(), string|ReadableStreamInterface $contents = ''): PromiseInterface<ResponseInterface>` method can be used to
1924+
The `post(string $url, array $headers = array(), string|ReadableStreamInterface $body = ''): PromiseInterface<ResponseInterface>` method can be used to
19251925
send an HTTP POST request.
19261926

19271927
```php
@@ -1983,7 +1983,7 @@ $browser->head($url)->then(function (Psr\Http\Message\ResponseInterface $respons
19831983

19841984
#### patch()
19851985

1986-
The `patch(string $url, array $headers = array(), string|ReadableStreamInterface $contents = ''): PromiseInterface<ResponseInterface>` method can be used to
1986+
The `patch(string $url, array $headers = array(), string|ReadableStreamInterface $body = ''): PromiseInterface<ResponseInterface>` method can be used to
19871987
send an HTTP PATCH request.
19881988

19891989
```php

src/Browser.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,12 @@ public function get($url, array $headers = array())
162162
*
163163
* @param string $url URL for the request.
164164
* @param array $headers
165-
* @param string|ReadableStreamInterface $contents
165+
* @param string|ReadableStreamInterface $body
166166
* @return PromiseInterface<ResponseInterface>
167167
*/
168-
public function post($url, array $headers = array(), $contents = '')
168+
public function post($url, array $headers = array(), $body = '')
169169
{
170-
return $this->requestMayBeStreaming('POST', $url, $headers, $contents);
170+
return $this->requestMayBeStreaming('POST', $url, $headers, $body);
171171
}
172172

173173
/**
@@ -220,12 +220,12 @@ public function head($url, array $headers = array())
220220
*
221221
* @param string $url URL for the request.
222222
* @param array $headers
223-
* @param string|ReadableStreamInterface $contents
223+
* @param string|ReadableStreamInterface $body
224224
* @return PromiseInterface<ResponseInterface>
225225
*/
226-
public function patch($url, array $headers = array(), $contents = '')
226+
public function patch($url, array $headers = array(), $body = '')
227227
{
228-
return $this->requestMayBeStreaming('PATCH', $url , $headers, $contents);
228+
return $this->requestMayBeStreaming('PATCH', $url , $headers, $body);
229229
}
230230

231231
/**
@@ -262,12 +262,12 @@ public function patch($url, array $headers = array(), $contents = '')
262262
*
263263
* @param string $url URL for the request.
264264
* @param array $headers
265-
* @param string|ReadableStreamInterface $contents
265+
* @param string|ReadableStreamInterface $body
266266
* @return PromiseInterface<ResponseInterface>
267267
*/
268-
public function put($url, array $headers = array(), $contents = '')
268+
public function put($url, array $headers = array(), $body = '')
269269
{
270-
return $this->requestMayBeStreaming('PUT', $url, $headers, $contents);
270+
return $this->requestMayBeStreaming('PUT', $url, $headers, $body);
271271
}
272272

273273
/**
@@ -281,12 +281,12 @@ public function put($url, array $headers = array(), $contents = '')
281281
*
282282
* @param string $url URL for the request.
283283
* @param array $headers
284-
* @param string|ReadableStreamInterface $contents
284+
* @param string|ReadableStreamInterface $body
285285
* @return PromiseInterface<ResponseInterface>
286286
*/
287-
public function delete($url, array $headers = array(), $contents = '')
287+
public function delete($url, array $headers = array(), $body = '')
288288
{
289-
return $this->requestMayBeStreaming('DELETE', $url, $headers, $contents);
289+
return $this->requestMayBeStreaming('DELETE', $url, $headers, $body);
290290
}
291291

292292
/**

0 commit comments

Comments
 (0)