Skip to content

Conversation

ghost
Copy link

@ghost ghost commented Mar 6, 2015

Resolves the warning:

PHP Warning: mb_strlen() expects parameter 1 to be string, array given in httpful/src/Httpful/Request.php on line 953

@nategood
Copy link
Owner

nategood commented Mar 8, 2015

The serialized payload that we pass to this method should always be a string. What case were you running into where this wasn't the case? @michelwilhelm

@ghost
Copy link
Author

ghost commented Mar 8, 2015

This is a snippet:

$animal = [
  'var' => 'foo'
];

$response = \Httpful\Request::post($request)->
        sendsJson()->
        body($animal)->
        addHeader('Authorization', 'Token  '.$user['token'])->
        addHeader('Content-Type', 'application/json')->
        addHeader('Accept', 'application/json')->
        send();

Copy link
Owner

@nategood nategood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah if serialized_payload isn't a sting there should be a slew of other problems. I would prefer this solution be fixed by casting the call of Request::_serializePayload to string.

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

Successfully merging this pull request may close these issues.

2 participants