cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Return custom HTTP Header

Henchway
Contributor

Iโ€™m trying to return a hash of a CSV document Iโ€™m returning in a triggered task and I want to return it in a HTTP header.
I would have thought i can do it the same way i can manipulate the status code by setting a binary header, but the headers arenโ€™t coming through.

Does anyone have an idea how to achieve this? (Ideally without buying any additional subscription services, thanks)

Hereโ€™s an example of the output of the csv formatter:
image

Best regards
Thomas

1 ACCEPTED SOLUTION

asharifian
Employee
Employee

Hi @Henchway,

If you are referring to having a SnapLogic triggered task respond with a custom HTTP header value, then these are the following scenarios:

  1. If youโ€™re using the ground URL on a groundplex, then itโ€™s possible by having the custom value go to the $[โ€˜content-typeโ€™] variable in a Mapper snap. Ensure your Mapper snap has a Binary output and that itโ€™s unlinked.

The $content variable within the Mapper will contain the response body so ensure thatโ€™s there if necessary.

  1. If youโ€™re using the cloud URL (whether it be via a groundplex or cloudplex), this is currently not possible and only standard HTTP headers can be returned in that case.

Thanks,

Ali

View solution in original post

3 REPLIES 3

cjhoward18
Employee
Employee

Hi @Henchway

If you have the key $content mapped in your response document, that will be considered the response body, and the rest of the key/value pairs are treated as response headers.

asharifian
Employee
Employee

Hi @Henchway,

If you are referring to having a SnapLogic triggered task respond with a custom HTTP header value, then these are the following scenarios:

  1. If youโ€™re using the ground URL on a groundplex, then itโ€™s possible by having the custom value go to the $[โ€˜content-typeโ€™] variable in a Mapper snap. Ensure your Mapper snap has a Binary output and that itโ€™s unlinked.

The $content variable within the Mapper will contain the response body so ensure thatโ€™s there if necessary.

  1. If youโ€™re using the cloud URL (whether it be via a groundplex or cloudplex), this is currently not possible and only standard HTTP headers can be returned in that case.

Thanks,

Ali

Thank you very much, i wasnโ€™t aware that I had to use the override URL to use custom headers!

Best regards
Thomas