Consume REST API with set cookie before the request
Application Type
Reactive
Service Studio Version
11.52.3 (Build 59963)

I need to call a rest api to get some information but i need to set a cookie with a session id before the request, i have tried with HTTPRequestHandler SetCookie action but does not work.

For example, i have a Python script and i'm able to set the cookies in the request header and it works fine but i don't know how to achieve the same in Outsystems.

Python Script:


Outsystems test:


Thanks in advance.

Hi
Eduardo,

Use OnBeforeRequestAdvance event instead of OnBeforeRequest  and use Rest_Extender forge component

HttpRequestHandler will set the cookiee in the current context and when you are calling a REST API a new request context is created and that is accessible on OnBeforeRequestAdvance for injecting some custom code.

https://www.outsystems.com/forge/component-overview/3278/rest-extender


Best Regards

Devendra

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