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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HttpClient] doc how to cancel a request + upload files #11668

Merged
merged 1 commit into from Jun 11, 2019

Conversation

Projects
None yet
5 participants
@nicolas-grekas
Copy link
Member

commented Jun 4, 2019

Fixes #11658. Needs symfony/symfony#31850

@nicolas-grekas nicolas-grekas force-pushed the nicolas-grekas:hc++ branch from 3cb560b to ed771e2 Jun 5, 2019

@nicolas-grekas nicolas-grekas changed the title [HttpClient] doc how to cancel a request [HttpClient] doc how to cancel a request + upload files Jun 5, 2019

@nicolas-grekas nicolas-grekas force-pushed the nicolas-grekas:hc++ branch from ed771e2 to 28d84ad Jun 5, 2019

nicolas-grekas referenced this pull request Jun 5, 2019

minor #11663 [HttpClient] Documented the cancel() method (javiereguiluz)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] Documented the cancel() method

Fixes #11658.

Commits
-------

a983ece [HttpClient] Documented the cancel() method
@nicolas-grekas

This comment has been minimized.

Copy link
Member Author

commented Jun 5, 2019

When merging this into 4.4, don't miss removing the changes done in #11663

@nicolas-grekas nicolas-grekas force-pushed the nicolas-grekas:hc++ branch from 28d84ad to 47c7d9f Jun 5, 2019

fabpot added a commit to symfony/symfony that referenced this pull request Jun 5, 2019

bug #31850 [HttpClient] add $response->cancel() (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] add $response->cancel()

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | symfony/symfony-docs#11668

An alternative to #31845 and #31842.
Same as  #31831 but considered as a bug fix (at the Contracts level), thus for 4.3.
I think we're early enough since 4.3/1.1 to do it.
That will save us some headaches in the short term.

Commits
-------

c402418 [HttpClient] add $response->cancel()

symfony-splitter pushed a commit to symfony/http-client that referenced this pull request Jun 5, 2019

bug #31850 [HttpClient] add $response->cancel() (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] add $response->cancel()

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | symfony/symfony-docs#11668

An alternative to #31845 and #31842.
Same as  #31831 but considered as a bug fix (at the Contracts level), thus for 4.3.
I think we're early enough since 4.3/1.1 to do it.
That will save us some headaches in the short term.

Commits
-------

c402418723 [HttpClient] add $response->cancel()

symfony-splitter pushed a commit to symfony/contracts that referenced this pull request Jun 5, 2019

bug #31850 [HttpClient] add $response->cancel() (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] add $response->cancel()

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | symfony/symfony-docs#11668

An alternative to #31845 and #31842.
Same as  #31831 but considered as a bug fix (at the Contracts level), thus for 4.3.
I think we're early enough since 4.3/1.1 to do it.
That will save us some headaches in the short term.

Commits
-------

c402418723 [HttpClient] add $response->cancel()

symfony-splitter pushed a commit to symfony/http-client-contracts that referenced this pull request Jun 5, 2019

bug #31850 [HttpClient] add $response->cancel() (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] add $response->cancel()

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | symfony/symfony-docs#11668

An alternative to #31845 and #31842.
Same as  #31831 but considered as a bug fix (at the Contracts level), thus for 4.3.
I think we're early enough since 4.3/1.1 to do it.
That will save us some headaches in the short term.

Commits
-------

c402418723 [HttpClient] add $response->cancel()
@nicolas-grekas

This comment has been minimized.

Copy link
Member Author

commented Jun 7, 2019

This can merged now :)

@nicolas-grekas nicolas-grekas force-pushed the nicolas-grekas:hc++ branch from 47c7d9f to 8221276 Jun 7, 2019

Show resolved Hide resolved components/http_client.rst Outdated
Show resolved Hide resolved components/http_client.rst
Show resolved Hide resolved components/http_client.rst Outdated

@nicolas-grekas nicolas-grekas force-pushed the nicolas-grekas:hc++ branch 2 times, most recently from d7c3a94 to d29eb7e Jun 7, 2019

},
]);

The exception will be wrapped in an instance of ``TransportExceptionInterface``

This comment has been minimized.

Copy link
@OskarStark

OskarStark Jun 7, 2019

Contributor

Unfortunately the symfony cloud endpoint for this PR is not bootstrapped yet :(
This belongs to the * throw an exception from a progress callback::-Part, but I am not sure if it will be rendered correct with this indention

cc @javiereguiluz

This comment has been minimized.

Copy link
@javiereguiluz

javiereguiluz Jun 7, 2019

Member

Yes, while merging we can reword this to remove the <ul> list and turn it into paragraphs:

To abort a request (e.g. because it didn't complete in due time, or you want to
fetch only the first bytes of the response, etc.), you can either use the ``cancel()`` 
method of ``ResponseInterface``:

   ...

Or throw an exception from a progress callback::

   ...

The exception will be wrapped in an instance of ``TransportExceptionInterface``
and will abort the request.
@OskarStark
Copy link
Contributor

left a comment

Thank you Nicolas 👍

@nicolas-grekas nicolas-grekas force-pushed the nicolas-grekas:hc++ branch from d29eb7e to 4dc3655 Jun 7, 2019

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

@javiereguiluz
Copy link
Member

left a comment

Very nice! Thanks Nicolas.

This means there is usually nothing to configure to have the client work with
proxies, provided these env vars are properly configured.

You can still set or override these settings using the `proxy`` and ``no_proxy``

This comment has been minimized.

Copy link
@javiereguiluz

javiereguiluz Jun 7, 2019

Member

There's a missing opening backtick in proxy:

`proxy`` -> ``proxy``
Show resolved Hide resolved components/http_client.rst Outdated
},
]);

The exception will be wrapped in an instance of ``TransportExceptionInterface``

This comment has been minimized.

Copy link
@javiereguiluz

javiereguiluz Jun 7, 2019

Member

Yes, while merging we can reword this to remove the <ul> list and turn it into paragraphs:

To abort a request (e.g. because it didn't complete in due time, or you want to
fetch only the first bytes of the response, etc.), you can either use the ``cancel()`` 
method of ``ResponseInterface``:

   ...

Or throw an exception from a progress callback::

   ...

The exception will be wrapped in an instance of ``TransportExceptionInterface``
and will abort the request.
Show resolved Hide resolved components/http_client.rst Outdated
@nicolas-grekas

This comment has been minimized.

Copy link
Member Author

commented Jun 9, 2019

Comments addressed, thank you all!

@nicolas-grekas nicolas-grekas force-pushed the nicolas-grekas:hc++ branch from d239af9 to b096999 Jun 9, 2019

@javiereguiluz

This comment has been minimized.

Copy link
Member

commented Jun 11, 2019

Thank you Nicolas.

@javiereguiluz javiereguiluz merged commit b096999 into symfony:4.3 Jun 11, 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 11, 2019

minor #11668 [HttpClient] doc how to cancel a request + upload files …
…(nicolas-grekas)

This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] doc how to cancel a request + upload files

Fixes #11658. Needs symfony/symfony#31850

Commits
-------

b096999 [HttpClient] doc how to cancel a request + upload files

@nicolas-grekas nicolas-grekas deleted the nicolas-grekas:hc++ branch Jun 15, 2019

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