Skip to content

Simplify syntax for POSTs, PATCHs, and PUTs

Latest
Compare
Choose a tag to compare
@ssfinney ssfinney released this 22 Feb 18:09
· 23 commits to develop since this release

Improve passing options to the client by setting the "body" key and encoding the options in JSON so the user doesn't have to.

For example, prior to this release I have to do this to pass in data to the client for POST, PATCH and PUT:

        $patch_data = [
            'body' => json_encode(
                [
                    'op'    => 'replace',
                    'path'  => '/priority/id',
                    'value' => $priority['id'],
                ]
            ),
        ];

$connectwise_client->patch("url/to/patch/to/$id", $patch_data);

With this release I'll only have to do this:

        $patch_data = [
                    'op'    => 'replace',
                    'path'  => '/priority/id',
                    'value' => $priority['id'],
                ];

$connectwise_client->patch("url/to/patch/to/$id", $patch_data);