691
Views
4
Comments
Solved
REST Callback Action OnBeforeRequest/OnAfterRequest
Question

Ok, Inside callback OnBeforeRequest WEB, there is an access, into informations and those are HTTPRequest and HTTResponse.

These infos can only be inside the callback action, and since we don't have the callback explicitly inside the logical flow, how do i should use those informations outside a CallBack Action .

All i want is the HTTP Response code inside the Plataform, I can get it using outside tools like Postman,

But, i need it inside my Application, so maybe i need to do a Server action with the responses whenever i do my Requests?

2022-05-03 11-39-19
Ruben van Vugt
Solution

Hi Caio,

We have implemented error handling and for every HTTP code you can implement an exception handler. With that exception handler you can call some other server actions and do whatever you like with the response from the API.

We followed this blog to implement it: https://www.outsystems.com/blog/posts/handling-http-status-codes-consuming-rest/

Does that answer your question on how to use the HTTP Resonse?

Regards,

Ruben

UserImage.jpg
Caio Lima

Ruben van Vugt wrote:

Hi Caio,

We have implemented error handling and for every HTTP code you can implement an exception handler. With that exception handler you can call some other server actions and do whatever you like with the response from the API.

We followed this blog to implement it: https://www.outsystems.com/blog/posts/handling-http-status-codes-consuming-rest/

Does that answer your question on how to use the HTTP Resonse?

Regards,

Ruben

Thanks Ruben!! That's just what i was thinking


2022-09-15 15-26-02
Leonardo Nascimento

Hi, Caio.

To handle the response (HTTP code), you can search this documentation.

You can implement logic within OnBefore or OnAfter to capture http status.

https://success.outsystems.com/Documentation/11/Extensibility_and_Integration/REST/Consume_REST_APIs/Simple_Customizations

2022-05-03 11-39-19
Ruben van Vugt

Nice! Don't forget marking the thread as solved

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.