-
Notifications
You must be signed in to change notification settings - Fork 11.4k
[9.x] Add uri templates to Http
client
#45982
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
Conversation
@@ -715,7 +736,7 @@ public function post(string $url, $data = []) | |||
* @param array $data | |||
* @return \Illuminate\Http\Client\Response | |||
*/ | |||
public function patch($url, $data = []) | |||
public function patch(string $url, $data = []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other methods were already type-hinted, so I updated these too. Let me know if this is wrong though.
return tap($this, function () use ($parameters) { | ||
$this->urlParameters = $parameters; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it the same as writing
return tap($this, function () use ($parameters) { | |
$this->urlParameters = $parameters; | |
}); | |
$this->urlParameters = $parameters; | |
return $this; |
Or am I missing something?
This is sick 🔥 |
@jbrooksuk |
@tvup good question, with multiple answers.
|
You should not include the question mark on the end there, in bullet v3. It is added for you.
|
Whoops, typo! |
This PR introduces the ability to use URI templates on the
Http
client. We pull inguzzlehttp/uri-templates
which follows the spec at https://www.rfc-editor.org/rfc/rfc6570This is using
guzzlehttp/uri-template
behind the scenes, which provides a much wider set of support features when expanding templates.