httpful
httpful copied to clipboard
Verify if is a string httpful/src/Httpful/Request.php on line 953
Resolves the warning:
PHP Warning: mb_strlen() expects parameter 1 to be string, array given in httpful/src/Httpful/Request.php on line 953
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
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();