ringcentral / ringcentral-php

RingCentral Connect Platform PHP SDK
MIT License
54 stars 52 forks source link

Add body param for delete request #136

Closed SushilMallRC closed 3 months ago

SushilMallRC commented 4 months ago

https://github.com/ringcentral/ringcentral-php/issues/134

SushilMallRC commented 3 months ago

Note:

Breaking Change: Added $body Parameter to delete Method

Change Summary: The delete method in our HTTP client now includes a new $body parameter. This change allows users to pass a request body with DELETE requests.

Previous Method Signature:

public function delete($url = '', $queryParameters = [], array $headers = [], $options = [])

New Method Signature:

public function delete($url = '', $body = null, $queryParameters = [], array $headers = [], $options = [])

Impact on Existing Code:

  1. Existing code that calls the delete method without a $body argument will continue to function as before, as the $body parameter is optional and defaults to null.
  2. However, codebases that rely on positional arguments in method calls will need to update their calls to handle the new parameter, particularly if they are passing arguments that previously matched queryParameters, headers, or options.

Recommended Action:

  1. Review all instances of the delete method call in your codebase.
  2. Update method calls to explicitly specify parameters using named arguments where necessary, especially if your code relies on the position of parameters after $url.

Example After Changes with request body

`$body = array( 'records' => array( 'id1', 'id2' ) );

delete( 'https://api.example.com/resource', $body, ['param1' => 'value'], // Query parameters ['Content-Type' => 'application/json'] // Headers );`