× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



The Idempotency of PUT doesn't usually last for an eternity in real life :)

POST "blah" "Hi"
POST "blah" "Hi"
Creates 2 resources

PUT /blah1 "Hi"
PUT /blah1 "Hi"
replaces a single resource "blah"

PUT /blah1 "Hi"
DELETE /blah1
PUT /blah1 "Hi"
could easily result in a 404 - Not found

Having said that, neither PUT nor POST feel quite right since you're not
saving anything.
It's too bad GET requests aren't really supposed to have a body. (Though
ElasticSearch makes use of them..)

If it were me, I think I'd stay with POST, and simply add an optional
"quote":true or something in the body...

HTH,
CHarles




On Fri, Feb 4, 2022 at 7:28 AM Dave <dfx1@xxxxxxxxxxxxxx> wrote:

Hi,

Having a problem getting my head around this and wondering if I really need
to understand.
I'm thinking that if my application receives the same input, then I should
always return the same output, but I don't see how that's possible. For
example, if the customer asks for a quote today, I'm not going to send
back the same data tomorrow if he sends me the same data and our prices
have changed since.

My web application is already receiving JSON data via a POST method. It
calculates and saves an order and sends the details of the payment back.
Now I have to create a simulation via a PUT method. The application will
receive the JSON data in the same format and do the same calculation except
there will be no saving of the order on our system, just the details of the
customer request.
So I'm thinking I'll just ignore the fact that the http method is PUT and
treat it as a POST.
Am I missing the point?
Thanks!
--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing
list
To post a message email: WEB400@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/web400.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.