How is your experience with the OutSystems Community?
16
Views
2
Comments
Solved
Add header to HTTPRequestHandler - GetRequest_Submit

Dear all,

to retrieve a Binary Data image from an URL we use the GetRequest_Submit.
Unfortunately we receive a 403, because the other side expects an User-Agent header.
Using the AddHeader is obviously not working.
Maybe somebody know how to accomplish this? If even possible?

Best regards,
Jeroen Vormer

2026-03-03 06-24-34
Grijesh Suman
Solution

Hi @Jeroen Vormer ,

The AddHeader action from HTTPRequestHandler won't help in this scenario because it adds headers to the HTTP response generated by OutSystems, not to the outbound request sent by GetRequest_Submit. According to the OutSystems documentation, AddHeader affects the current HTTP response only.

If the target server requires a User-Agent header (which is common for image servers, CDNs, and websites that block non-browser requests), GetRequest_Submit does not provide a way to inject custom request headers. As a result, the remote server may return a 403 Forbidden response.

In such cases, a possible workaround is to use a consumed REST API and configure the required request headers there, or use a Forge component such as  Advanced HTTP or HTTP Request

or create custom .NET extension based on HttpClient, which gives full control over outbound headers such as User-Agent, Authorization, Referer, etc.

We've run into similar situations when retrieving binary content from external URLs, and switching to a REST-based approach was the most straightforward solution. 


2019-03-18 10-26-38
Jeroen Vormer
Solution

Hi @Grijesh Suman,

indeed the AddHeader is not working obviously.
Unfortunately there's not another way using normal OutSystems actions to add the header, so indeed I ended up with a REST-API-approach.
Thank you for your reply!

2026-03-03 06-24-34
Grijesh Suman
Solution

Hi @Jeroen Vormer ,

The AddHeader action from HTTPRequestHandler won't help in this scenario because it adds headers to the HTTP response generated by OutSystems, not to the outbound request sent by GetRequest_Submit. According to the OutSystems documentation, AddHeader affects the current HTTP response only.

If the target server requires a User-Agent header (which is common for image servers, CDNs, and websites that block non-browser requests), GetRequest_Submit does not provide a way to inject custom request headers. As a result, the remote server may return a 403 Forbidden response.

In such cases, a possible workaround is to use a consumed REST API and configure the required request headers there, or use a Forge component such as  Advanced HTTP or HTTP Request

or create custom .NET extension based on HttpClient, which gives full control over outbound headers such as User-Agent, Authorization, Referer, etc.

We've run into similar situations when retrieving binary content from external URLs, and switching to a REST-based approach was the most straightforward solution. 


2019-03-18 10-26-38
Jeroen Vormer
Solution

Hi @Grijesh Suman,

indeed the AddHeader is not working obviously.
Unfortunately there's not another way using normal OutSystems actions to add the header, so indeed I ended up with a REST-API-approach.
Thank you for your reply!

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