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

POST vs PUT pixel #32

Open
Dennis-Dang opened this issue May 18, 2023 · 1 comment
Open

POST vs PUT pixel #32

Dennis-Dang opened this issue May 18, 2023 · 1 comment

Comments

@Dennis-Dang
Copy link

Hi, I'm new to programming and just got started working on a fun project with APIs with python. I am not totally new to how APIs work, but know enough.

I am having trouble distinguishing the behavior of these two methods. I've seen tutorial videos made in the past where the POST method will not work if there is already an existing Pixel present on the same date. But oddly enough, that's now allowed. How is this different from modifying my Pixel with the PUT method to update it?

Should the PUT method be strictly only be used to modify Pixels, and the POST method be strictly used to create new pixels as worded in the documentation?

TLDR; how is it that I am able to overwrite/modify Pixels with the POST method? Is this an intended feature or a minor bug that should be addressed?

@a-know
Copy link
Owner

a-know commented May 18, 2023

@Dennis-Dang
Hi, thank you for asking. Good question.

Originally, the POST method could not update an existing pixel and the PUT method could not register a new pixel.
It was close to what it should have been for REST, but yes, it was very inconvenient.

This led to the current specifications that we have to this day.
If Pixela were to make a major upgrade, this would be a smarter specification.

However, there are still minor differences between the two at this time.
That is, the PUT method can update partial properties (docs). If that sounds attractive to you, then by all means use the PUT method. 😉

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