Skip to content

Add data processing using the Curl::buildPostData() in the Curl::patch() #205

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

Merged
merged 1 commit into from
Aug 20, 2015

Conversation

valeriitropin
Copy link
Contributor

When I tried to send a PATCH request with data as a multidimensional array, I got the following notification "Array to string conversion Curl/Curl.php:681". Data processing using method buildPostData() fixed this issue.

@zachborboa
Copy link
Member

Hi thank you for the pull request. Do you have an example I can reproduce this for a test case?

@valeriitropin
Copy link
Contributor Author

Hello,
I dont have any idea how to write test for this case because it is php notice.

You can try to reproduce it using the following example:
$curl = new Curl\Curl();
$curl->patch('http://localhost', [
'data' => [
'key' => 'value',
'key1' => 'value2',
],
]);

And as the result you'll get the following:
Notice: Array to string conversion in /home/valerio/projects/php/localhost/libraries/Curl/Curl.php on line 681

zachborboa added a commit that referenced this pull request Aug 20, 2015
Add test for PATCHing a multidimensional array (#205)
@zachborboa
Copy link
Member

That pointed me in the right directions. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants