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

Documented the new HttpClient component#11071

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

Closed

Conversation

@javiereguiluz
Copy link
Member

Lutacon and derrabus reacted with hooray emoji

You can either handle cookies yourself using the ``Cookie`` HTTP header or use
the:doc:`BrowserKit component</components/browser_kit>` which provides this
feature and integrates seamlessly with the HttpClient component.
Copy link
Member

@zanbaldwinzanbaldwinMar 1, 2019
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Some extra explanation is probably needed here.

I haven't seen anything insymfony/symfony#30413 relating to the BrowserKit component and the documentation for the Browser component states you must implement thedoRequest(Request $request): Response method, meaning you'd have to:

  • Convert$request object to$httpClient->request($method, $url, $options)
  • ConvertSymfony\Contracts\HttpClient\ResponseInterface toSymfony\Component\HttpFoundation\Response

This is non-trivial, and definitely not seamless. Perhaps an idea would be to add a static helper method (likeSymfony\Component\HttpClient\HttpOptions::fromFoundationRequest($request)) and add an example in this section.

(I know you've mentioned you're also improving BrowserKit, and may have already addressed this - if so ignore this!)

EDIT I just read Fabien's slides and saw that there's going to be a newSymfony\Component\BrowserKit\BrowserClient(HttpClientInterface $client) class. Once that's merged in it would still be a good idea to show an example of that here 🙂

javiereguiluz reacted with thumbs up emojiAdamKyle reacted with thumbs down emoji
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Perfectly explained! We need to wait for the merge of the BrowserKit improvements and then we'll add a mention here. Thanks.

OskarStark
OskarStark previously requested changesMar 1, 2019
// defining data using a regular string
'body' => 'raw data',

// using a closure to generate the uploaded data
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Should we add some explanation of what the closure needs to return?

derrabus and Nyholm reacted with thumbs up emoji
Copy link
Member

@NyholmNyholm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I like it!

-----------------------

HTTP/2 is only supported when using the cURL-based transport and the libcurl
version is >= 7.36.0. If you meet these requirements, you can enable HTTP/2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This is not the only requirement. Curl has to be compiled with libnghttp2 as well. Not sure if we should mention that though.
Basically, HTTP2 support is automatically enabled if your environment supports it.

},
]);

// Responses are lazy: this code is executed as soon as headers are received
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This is not exactly true, is it?
We send the request as soon as you run the $response-getStatusCode().

@nicolas-grekas
Copy link
Member

@javiereguiluz do you think you'll be able to move this PR forward soonish?

@javiereguiluz
Copy link
MemberAuthor

@nicolas-grekas as we discussed, I've finished most of this PR. I've added most of reviewer's suggestions too. The pending suggestions are the ones still visible (the fixed ones has been marked as "resolved"). This is now ready for you! Thanks.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@OskarStarkOskarStarkOskarStark left review comments

@xabbuhxabbuhxabbuh left review comments

+5 more reviewers

@zanbaldwinzanbaldwinzanbaldwin left review comments

@nclsHartnclsHartnclsHart left review comments

@dmaicherdmaicherdmaicher left review comments

@NyholmNyholmNyholm left review comments

@derrabusderrabusderrabus left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.3

Development

Successfully merging this pull request may close these issues.

10 participants

@javiereguiluz@nicolas-grekas@zanbaldwin@nclsHart@dmaicher@OskarStark@Nyholm@derrabus@xabbuh@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp