Skip to content

[HttpClient][FrameworkBundle] Allow to configure Http Client transport #35651

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

Koc
Copy link
Contributor

@Koc Koc commented Feb 8, 2020

Q A
Branch? master
Bug fix? no
New feature? yes
Deprecations? no
Tickets -
License MIT
Doc PR -

Provide new configuration node transport with possible values: auto, curl, native, mock. Would be useful in test env to replace all http clients with mock implementation.

Tests in progress.

@Koc Koc force-pushed the feature/configure-http-client-transport branch from 5861079 to 9ed3897 Compare February 8, 2020 20:56
@nicolas-grekas nicolas-grekas added this to the next milestone Feb 10, 2020
@nicolas-grekas
Copy link
Member

Can you hint us more about how this is useful? Providing a mock won't really help out of the box so some pieces are missing, how do you do this? (the answer should be useful for the doc too.)

#30661 will have some interaction with this I suppose.

@Koc
Copy link
Contributor Author

Koc commented Feb 10, 2020

I plan to merge configuration as the 1st step and after merging it make mocking http client mutable and implement resettable interface, create some assertion trait.

@Nyholm
Copy link
Member

Nyholm commented May 3, 2020

Im on the fence with this PR.

Using the HttpClient in non-test, then it generally does not matter if I get the NativeClient or the CurlClient. (In the rare instances it actually matters, I define the service myself.)

Whenever I write tests with the HttpClient, I just define a service in my test environment. It is easier since I've got more control how I actually mock things.

So Im not sure this will actually be an improvement.

@fabpot
Copy link
Member

fabpot commented Aug 18, 2020

Closing as this PR is stale and two core team members are not convinced. Thanks for proposing.

@fabpot fabpot closed this Aug 18, 2020
@nicolas-grekas nicolas-grekas modified the milestones: next, 5.2 Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants