You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently when script executes, either through webhook or http route, we cannot control the headers and status codes that a client will receive. All responses are sent with 200 status code and the json body.
I propose to add more control to developers, so we could change the response as we need. For example, we could use it to set cookies, redirect and so on.
Ideally, it could be implemented with a special object for every programming language (except shells), which, if being returned, would be converted to a native response for the framework that the API itself uses. However, I understand that could be too much work and will make adding a new language support harder.
As a simpler alternative, it could be implemented just by adding a pre-defined key into the response object, that the API would interpret when returning the response. This could cause collisions with existing responses, so we could name it something like _windmill_http_response_metadata (it would be even better if we could change the name in the settings).
So, to customize the response, a script should:
API should send an http response with the 201 code and set-cookies headers, keeping the default application/json content type and the body, if called through webhook or http route.
The text was updated successfully, but these errors were encountered:
Note: this is only relevant for sync executions.
Currently when script executes, either through webhook or http route, we cannot control the headers and status codes that a client will receive. All responses are sent with 200 status code and the json body.
I propose to add more control to developers, so we could change the response as we need. For example, we could use it to set cookies, redirect and so on.
Ideally, it could be implemented with a special object for every programming language (except shells), which, if being returned, would be converted to a native response for the framework that the API itself uses. However, I understand that could be too much work and will make adding a new language support harder.
As a simpler alternative, it could be implemented just by adding a pre-defined key into the response object, that the API would interpret when returning the response. This could cause collisions with existing responses, so we could name it something like
_windmill_http_response_metadata
(it would be even better if we could change the name in the settings).So, to customize the response, a script should:
For example, if a python script returns a dict
API should send an http response with the 201 code and set-cookies headers, keeping the default
application/json
content type and the body, if called through webhook or http route.The text was updated successfully, but these errors were encountered: