Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HttpMethod::PUT is not implemented. #158

Open
acepoblete opened this issue Jul 29, 2024 · 4 comments
Open

HttpMethod::PUT is not implemented. #158

acepoblete opened this issue Jul 29, 2024 · 4 comments

Comments

@acepoblete
Copy link

I'm working on a system that talks to an Acumatica oData service. Creating/updating records requires using the put verb (don't ask me why). Any chance adding a put method into the mix is possible?

@anderly
Copy link
Member

anderly commented Jul 29, 2024

You should be able to use patch for this. Have you tried the patch method on ODataClient?

@acepoblete
Copy link
Author

I have. For some reason Acumatica has put constraints on which verbs are used for creating and updating an entity. And to create you have to use put. Again, I have no clue why or what the reasoning is.

@anderly
Copy link
Member

anderly commented Jul 29, 2024

The helper methods on ODataClient simply forward to the request method here, so you can try calling request directly like this:

    $client->request(HttpMethod::PUT, $requestUri, $body);

This is using the HttpMethod enum here which defines PUT.

If that works, we can look at adding a put helper method like the others.

@acepoblete
Copy link
Author

I'm doing that now, and it works. But there are some scenarios where it would be nice to use the fluent API and be able to incorporate the expand method into a put. If it's a pretty straightforward change I would be willing to submit a PR, I need some help figuring out where the right place to start is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants