Hello everyone, hope you all are well! I need help with in how to send the Location property of the headers in my User Defined API response. I didn't find any information in the documentation abut it, but our client requires that information in the headers of the response.
I'll leave the output of my api here:
return new ApiTriggerOutput
{
ResponseBody = responseMessage,
ResponseCode = 201,
};
Thank you in advance!
Hi João,
Unfortunately, setting headers on a User-Defined API response is not something we currently support. The only way to add data to a response currently, is using the ResponseBody.
I can maybe help you looking for a workaround. Just to make sure I understand you correctly, do you want to get the Location header from the User-Defined API request? Or do you want to add the Location header to the headers of your API response?

Ok, I'm assuming, since you use the 201 Created status code in your response, that your Location header will include the location of a resource that your API creates? Would it be an option to include this location in the ResponseBody? I'm afraid that is the only way to currently work around this limitation. I will link this Dojo question to a task on our backlog to implement HTTP headers, that way I can inform you if we would at some point in the future would implement this.
I will talk to our client and see if he accepts sending via ResponseBody, as soon as I have a position I will get back to you. Thank you for your help Wouter!
Hi Wouter! I spoke to our client and they need it to be sent via Location in the response Header, because according to them, the system was developed following this logic. If you have a deadline for that implementation we like to know. Thank you in advance and my regards!

Hi João, will this location header always contain the same location? Because in that case, we could as a workaround make a rewrite rule in IIS that sets this header hardcoded on every response.
Hi Wouter, thank you for your response! I want to add the Location header to the headers of my API response.