Hi All,
I have a get and post Api but those api dont have any status code but i want status as response . how can i add add status code in any api response.
Please suggest me any idea .and please send me any link or oml file??
Hi
To set a status code use the SetStatusCode action from the HttpRequestHandler module.
For all 2XX codes use this action in your regular flow. Add a user exception after all error codes.
Best
Stefan
Hi,
You need to set status code by calling the SetStatusCode method. For more details about HTTP status code and how to set its value please go through this URL : https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Extensibility_and_Integration/REST_APIs/Exposed_REST_API/Built-in_HTTP_Status_Codes
You can use the SetStatusCode action of the HTTPRequestHandler extension to set a custom status code. Please note that this is an advanced extensibility scenario, so be sure to test if it works as intended in your specific infrastructure.
regards
Hello
Here we have a step by step guide to implement HTTP Status Codes, while Exposing a Rest API Check here - https://www.outsystems.com/blog/posts/implementing-http-status-code-exposing-rest/
Thanks