Skip to content

Commit 75f1653

Browse files
SirRFIrafal
authored and
rafal
committed
[HttpClient] Make URL/path slashes consistent, fix comment
1 parent 1e85665 commit 75f1653

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

http_client.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,9 +1478,9 @@ to also test the request itself? ``MockResponse`` comes with helper methods:
14781478
Usage example::
14791479

14801480
$mockResponse = new MockResponse('', ['http_code' => 204]);
1481-
$httpClient = new MockHttpClient($mockResponse, 'https://example.com/');
1481+
$httpClient = new MockHttpClient($mockResponse, 'https://example.com');
14821482

1483-
$response = $httpClient->request('DELETE', '/api/article/1337', [
1483+
$response = $httpClient->request('DELETE', 'api/article/1337', [
14841484
'headers' => [
14851485
'Accept: */*',
14861486
'Authorization: Basic YWxhZGRpbjpvcGVuc2VzYW1l',
@@ -1490,7 +1490,7 @@ Usage example::
14901490
// returns "DELETE"
14911491
$mockResponse->getRequestMethod();
14921492

1493-
// returns "https://example.com//api/article/1337"
1493+
// returns "https://example.com/api/article/1337"
14941494
$mockResponse->getRequestUrl();
14951495

14961496
// returns ["Accept: */*", "Authorization: Basic YWxhZGRpbjpvcGVuc2VzYW1l"]
@@ -1559,7 +1559,7 @@ test it in real application::
15591559
'response_headers' => ['Content-Type: application/json'],
15601560
]);
15611561

1562-
$httpClient = new MockHttpClient($mockResponse, 'https://example.com/');
1562+
$httpClient = new MockHttpClient($mockResponse, 'https://example.com');
15631563
$service = new ExternalArticleService($httpClient);
15641564

15651565
// Act

0 commit comments

Comments
 (0)