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

Inconsistent QueryParam handling with $body #1

Closed
lathspell opened this issue Oct 5, 2016 · 1 comment
Closed

Inconsistent QueryParam handling with $body #1

lathspell opened this issue Oct 5, 2016 · 1 comment

Comments

@lathspell
Copy link

lathspell commented Oct 5, 2016

You have get($url, $body) where $body is expanded by http_build_query() and used as HTTP Query Parameter and post($url, $body) where $body is not used as Query Parameter but as HTTP Body.

How am I supposed to do a PUT request that uses both, Query Params and a HTTP Body?

Shouldn't post/put/delete all have an optional third parameter i.e. post($url, array $queryParams, $body=null)?

(of course, the quick fix is to add the Query Parameters to $url oneself when using POST but that's what I mean with "inconsistent")

@othercodes
Copy link
Owner

You must build the query string manually, the $body parameter, now only works in POST, PUT, and PATCH methods. If a POST call need for some reason also a query yuo must build the query string manually.

ItsReddi referenced this issue in ItsReddi/rest May 18, 2021
othercodes pushed a commit that referenced this issue Oct 8, 2023
…must be of type object|string, bool given (#12)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants