Ask HN: Using REST design for complex function calls?

2 points by oconnor0 ↗ HN
I like everything I've read about REST but am confused about how to use REST designs for an API with mostly complex, math-y function calls that compute values & return them.

Because the functions require complex - potentially, arbitrarily large - inputs, it's too difficult to pass them in via GETs.

Is there discussion or articles somewhere about using REST for computational APIs rather than for resource-based APIs?

2 comments

[ 4.9 ms ] story [ 13.3 ms ] thread
There's nothing about REST that requires you do use GETs for everything, quite the opposite in fact (read up on how the Rails REST API is designed for some inspiration).

Then again, unless you want to make a given function/input combination into a resource, you might be better of with a less RESTy approach.

Right, it wasn't that I thought you had to use GETs for everything, but that, being these are calls that change nothing on the server, GET was appropriate.