Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HttpClient] Service name #11648

Merged
merged 1 commit into from Jun 3, 2019

Conversation

Projects
None yet
5 participants
@Guikingone
Copy link
Contributor

commented Jun 3, 2019

Hi everyone 馃憢

I've tried to use multiples clients and it seems that the services are named as the configuration (ex: @crawler.client) declares it and not using the @http_client.client syntax, I don't know if it's a normal behaviour or just an error on the documentation 馃檨

Thanks for the feedback

@javiereguiluz javiereguiluz added this to the 4.3 milestone Jun 3, 2019

@javiereguiluz

This comment has been minimized.

Copy link
Member

commented Jun 3, 2019

@Guikingone the current docs were contributed/reviewed by @nicolas-grekas, so they are probably right. Maybe it's a bug in the code that doesn't generate the intended service names?

@Guikingone

This comment has been minimized.

Copy link
Contributor Author

commented Jun 3, 2019

@javiereguiluz Yes, I think that @nicolas-grekas is right, here's the configuration that cause this case:

framework:
    secret: '%env(APP_SECRET)%'
    session:
        handler_id: ~
        cookie_secure: auto
        cookie_samesite: lax
    php_errors:
        log: true
    http_client:
        scoped_clients:
            github.client:
                base_uri: '%env(OAUTH_GITHUB_API_URL)%'
                http_version: '2.0'

Here's the container dump:

    <service id="github.client" class="Symfony\Component\HttpClient\ScopingHttpClient">
      <argument type="service" id="http_client"/>
      <argument>%env(OAUTH_GITHUB_API_URL)%</argument>
      <argument type="collection">
        <argument key="base_uri">%env(OAUTH_GITHUB_API_URL)%</argument>
        <argument key="http_version">2.0</argument>
        <argument key="query" type="collection"/>
        <argument key="headers" type="collection"/>
        <argument key="resolve" type="collection"/>
      </argument>
      <factory class="Symfony\Component\HttpClient\ScopingHttpClient" method="forBaseUri"/>
    </service>

I've searched for http_client.github but nothing :/

@OskarStark OskarStark added the bug label Jun 3, 2019

@javiereguiluz

This comment has been minimized.

Copy link
Member

commented Jun 3, 2019

Thank you Guillaume.

@javiereguiluz javiereguiluz merged commit 0f4f64e into symfony:4.3 Jun 3, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
symfony SymfonyCloud: Environment deployed
Details

javiereguiluz added a commit that referenced this pull request Jun 3, 2019

minor #11648 [HttpClient] Service name (Guikingone)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] Service name

Hi everyone 馃憢

I've tried to use multiples clients and it seems that the services are named as the configuration (ex: `@crawler.client`) declares it and not using the `@http_client.client` syntax, I don't know if it's a normal behaviour or just an error on the documentation 馃檨

Thanks for the feedback

Commits
-------

0f4f64e fix(DI): service name

@Guikingone Guikingone deleted the Guikingone:patch-22 branch Jun 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.