[9.x] Add uri templates to Http client#45982
Merged
Merged
Conversation
jbrooksuk
commented
Feb 6, 2023
| * @return \Illuminate\Http\Client\Response | ||
| */ | ||
| public function patch($url, $data = []) | ||
| public function patch(string $url, $data = []) |
Member
Author
There was a problem hiding this comment.
The other methods were already type-hinted, so I updated these too. Let me know if this is wrong though.
mathieutu
reviewed
Feb 6, 2023
Comment on lines
+458
to
+460
| return tap($this, function () use ($parameters) { | ||
| $this->urlParameters = $parameters; | ||
| }); |
Contributor
There was a problem hiding this comment.
Isn't it the same as writing
Suggested change
| return tap($this, function () use ($parameters) { | |
| $this->urlParameters = $parameters; | |
| }); | |
| $this->urlParameters = $parameters; | |
| return $this; |
Or am I missing something?
Member
|
This is sick 🔥 |
|
@jbrooksuk |
Member
Author
|
@tvup good question, with multiple answers.
|
Collaborator
|
You should not include the question mark on the end there, in bullet v3. It is added for you. |
Member
Author
|
Whoops, typo! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces the ability to use URI templates on the
Httpclient. We pull inguzzlehttp/uri-templateswhich follows the spec at https://www.rfc-editor.org/rfc/rfc6570This is using
guzzlehttp/uri-templatebehind the scenes, which provides a much wider set of support features when expanding templates.