Conversation
There was a problem hiding this comment.
Does this PR also need to consider a fix for the Http::request method so that the situation described in #197 cannot happen by design?
At the moment if I were to do something like this, it would still cause the server-side encoding errors:
$payload = array(
"channels" => ["channel1", "channel2", "channel3", "channel4"],
"messages" => array(
"id" => "1",
"data" => "foo"
)
);
$batchPublishPaginatedResult = $ablyrest->request("POST", "/messages", [], json_encode($payload));This is because passing a string to AblyRest will cause it not to be encoded any further (we check for !is_string before applying JSON/msgpack), but Http::request will still add the Content-Type header (incorrectly) all the same.
2c1b168 to
641c808
Compare
|
@AndyTWF I agree with your point. |
|
I feel use of type |
In other SDKs (e.g. Java) we avoid the issue because the Next time there's a breaking version of this SDK, we should consider enforcing parameters types on the |
Related to #197