Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 3663

What method of a REST API is the correct one for procssing data without saving? [closed]

$
0
0

I have a backend service, which accepts a text with placeholders, replaces those placeholders with values and sends the text back.

What would be the proper method of an REST API to use for this?

Currently I would favour POST because I would send data in the body and also expect to receive some. But POST should be used to create something new in my understanding. Would PUT be better? Since I do a kind of update here? But I am not persisting the data in any way.

Technically of course both should work.

Example:

{    requestId: 123456,    text: 'Lorem ipsum dolor [placeholder_1] sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo  [placeholder_3] duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed [placeholder_2]  diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.'}

In reality the sent text will be much, much longer so in no way can I send it via an url.


Viewing all articles
Browse latest Browse all 3663

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>