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

Cut 'empty' params in request (JSONBody) #24

Open
aburnet opened this issue Mar 22, 2021 · 2 comments
Open

Cut 'empty' params in request (JSONBody) #24

aburnet opened this issue Mar 22, 2021 · 2 comments

Comments

@aburnet
Copy link

aburnet commented Mar 22, 2021

I'm trying to do something like this:
$request = [ 'loginId' => $hostData->getUser()->getUsername(), 'sendForgotPasswordEmail' => false ]; $response = $this->client->forgotPassword($request);
but library remove params sendForgotPasswordEmail. I found something like this in code (JSONBodyHandler:427)
$this->body = json_encode(array_filter($bodyObject));
function array_filter without callback remove all empty records from array. In my case remove sendForgotPasswordEmail but it is general problem with this function. It remove values with false and 0.

@mooreds
Copy link
Contributor

mooreds commented Mar 22, 2021

Ah, that is an issue. Can you please try

$request = [ 'loginId' => $hostData->getUser()->getUsername(), 'sendForgotPasswordEmail' => "false" ];

and see if that gets you what you want?

@aburnet
Copy link
Author

aburnet commented Mar 23, 2021

yes, it is working, but not looks good. But solves problem, thanks.

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