kre / Kinetic-Rules-Engine

Source code for KRE
GNU General Public License v2.0
54 stars 8 forks source link

Response handler for SkyCloud #81

Open windley opened 9 years ago

windley commented 9 years ago

Presently, the response from a function in SkyCloud (i.e. sharing on) is always JSON. Makes images, etc. difficult to handle.

We could:

Benefit of handler function is that it could do other standardizing operation like wrapping response in standard JSON response. For example, if the programmer wants to always return

{"status_code" : 200,
 "status_text": "OK",
 "data" : <response>
}

a response handler would let the programmer declare that once and functions would just produce the data without all having to call the handler specifically. Internal calls wouldn't see the handler wrapping. Tha tmight be good or bad.

windley commented 9 years ago

How does the response handler know there was an error for it's wrapper? How does it now the content type?