Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[HttpClient] Add ScopingHttpClient::forBaseUri() + tweak MockHttpClient#30843

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:masterfromnicolas-grekas:hc-forbaseuri
Apr 3, 2019

Conversation

@nicolas-grekas
Copy link
Member

@nicolas-grekasnicolas-grekas commentedApr 3, 2019
edited
Loading

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets-
LicenseMIT
Doc PR-

This allows creating scoped HTTP clients in one line:

$client = ScopingHttpClient::forBaseUri($client,'http://example.com');

$client now resolves relative URLs using the provided base URI.

If one also adds default options as 3rd argument, these will be applied conditionally when a URL matching the base URI is requested.

This PR also tweaksMockHttpClient to make it returnMockResponse on its own when no constructor argument is provided, easing tests a bit.

@fabpot
Copy link
Member

Thank you@nicolas-grekas.

@fabpotfabpot merged commit2b9b8e5 intosymfony:masterApr 3, 2019
fabpot added a commit that referenced this pull requestApr 3, 2019
…ak MockHttpClient (nicolas-grekas)This PR was merged into the 4.3-dev branch.Discussion----------[HttpClient] Add ScopingHttpClient::forBaseUri() + tweak MockHttpClient| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | -| License       | MIT| Doc PR        | -This allows creating scoped HTTP clients in one line:```php$client = ScopingHttpClient::forBaseUri($client, 'http://example.com');````$client` now resolves relative URLs using the provided base URI.If one also adds default options as 3rd argument, these will be applied conditionally when a URL matching the base URI is requested.This PR also tweaks `MockHttpClient` to make it return `MockResponse` on its own when no constructor argument is provided, easing tests a bit.Commits-------2b9b8e5 [HttpClient] Add ScopingHttpClient::forBaseUri() + tweak MockHttpClient
@nicolas-grekasnicolas-grekas deleted the hc-forbaseuri branchApril 12, 2019 12:28
@nicolas-grekasnicolas-grekas modified the milestones:next,4.3Apr 30, 2019
@fabpotfabpot mentioned this pull requestMay 9, 2019
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

4.3

Development

Successfully merging this pull request may close these issues.

4 participants

@nicolas-grekas@fabpot@javiereguiluz@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp