Add PUT method support to ODataClient #173
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a convenient
put()method to the ODataClient class to support HTTP PUT requests, which are required by some OData services like Acumatica.Changes Made
Added
put()method to ODataClient:Updated IODataClient interface:
put($requestUri, $body)method declarationpost(),patch(), anddelete()methods to fix interface consistencyUsage
Users can now use the convenient method instead of calling
request()directly:This provides the same consistent API as other HTTP methods:
The
HttpMethod::PUTconstant already existed in the codebase, so this change simply adds the convenience method that follows the exact same pattern as the existing HTTP method helpers.Fixes #158.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/CarbonPHP/carbon-doctrine-types/zipball/18ba5ddfec8976260ead6e866180bd5d2f71aa1d/usr/bin/php8.3 -n -c /tmp/7BoryR /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/CarbonPHP/carbon/zipball/76b5c07b8a9d2025ed1610e14cef1f3fd6ad2c24/usr/bin/php8.3 -n -c /tmp/7BoryR /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/doctrine/inflector/zipball/6d6c96277ea252fc1304627204c3d5e6e15faa3b/usr/bin/php8.3 -n -c /tmp/7BoryR /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/guzzle/guzzle/zipball/b51ac707cfa420b7bfd4e4d5e510ba8008e822b4/usr/bin/php8.3 -n -c /tmp/7BoryR /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/guzzle/promises/zipball/481557b130ef3790cf82b713667b43030dc9c957/usr/bin/php8.3 -n -c /tmp/7BoryR /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/guzzle/psr7/zipball/21dc724a0583619cd1652f673303492272778051/usr/bin/php8.3 -n -c /tmp/7BoryR /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/illuminate/collections/zipball/2737a0477a3f4855a71bf8f3d0b8d32596ded628/usr/bin/php8.3 -n -c /tmp/7BoryR /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/illuminate/conditionable/zipball/ec677967c1f2faf90b8428919124d2184a4c9b49/usr/bin/php8.3 -n -c /tmp/7BoryR /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/illuminate/contracts/zipball/f1c4cf02c9ab81a9ce47940cf261fa2386ed6c5d/usr/bin/php8.3 -n -c /tmp/7BoryR /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/illuminate/macroable/zipball/e862e5648ee34004fa56046b746f490dfa86c613/usr/bin/php8.3 -n -c /tmp/7BoryR /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/illuminate/support/zipball/487bbe527806615b818e87c364d93ba91f27db9b/usr/bin/php8.3 -n -c /tmp/7BoryR /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d/usr/bin/php8.3 -n -c /tmp/7BoryR /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963/usr/bin/php8.3 -n -c /tmp/7BoryR /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90/usr/bin/php8.3 -n -c /tmp/7BoryR /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a/usr/bin/php8.3 -n -c /tmp/2hTsIi /usr/bin/composer install(http block)/usr/bin/php8.3 -n -c /tmp/7BoryR /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71/usr/bin/php8.3 -n -c /tmp/7BoryR /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865/usr/bin/php8.3 -n -c /tmp/7BoryR /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/phpstan/phpstan/zipball/41600c8379eb5aee63e9413fe9e97273e25d57e4/usr/bin/php8.3 -n -c /tmp/7BoryR /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822/usr/bin/php8.3 -n -c /tmp/7BoryR /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/24ed13d98130f0e7122df55d06c5c4942a577957/usr/bin/php8.3 -n -c /tmp/7BoryR /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/47e34210757a2f37a97dcd207d032e1b01e64c7a/usr/bin/php8.3 -n -c /tmp/7BoryR /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/type/zipball/462699a16464c3944eefc02ebdd77882bd3925bf/usr/bin/php8.3 -n -c /tmp/7BoryR /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/version/zipball/c51fa83a5d8f43f1402e3f32a005e6262244ef17/usr/bin/php8.3 -n -c /tmp/7BoryR /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/clock/zipball/b81435fbd6648ea425d1ee96a2d8e68f4ceacd24/usr/bin/php8.3 -n -c /tmp/7BoryR /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62/usr/bin/php8.3 -n -c /tmp/7BoryR /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493/usr/bin/php8.3 -n -c /tmp/7BoryR /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/polyfill-php83/zipball/17f6f9a6b1735c0f163024d959f700cfbc5155e5/usr/bin/php8.3 -n -c /tmp/7BoryR /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/polyfill-php84/zipball/d8ced4d875142b6a7426000426b8abc631d6b191/usr/bin/php8.3 -n -c /tmp/7BoryR /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/polyfill-php85/zipball/d4e5fcd4ab3d998ab16c0db48e6cbb9a01993f91/usr/bin/php8.3 -n -c /tmp/7BoryR /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/translation-contracts/zipball/df210c7a2573f1913b2d17cc95f90f53a73d8f7d/usr/bin/php8.3 -n -c /tmp/7BoryR /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/translation/zipball/e0837b4cbcef63c754d89a4806575cada743a38d/usr/bin/php8.3 -n -c /tmp/7BoryR /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/voku/portable-ascii/zipball/b1d923f88091c6bf09699efcd7c8a1b1bfd7351d/usr/bin/php8.3 -n -c /tmp/7BoryR /usr/bin/composer install --no-interaction(http block)If you need me to access, download, or install something from one of these locations, you can either:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.