Expand my Community achievements bar.

Add custom header in Adobe IO call

Avatar

Level 1

Hi Team,

 

My requirement is to set a custom header in the request which Adobe IO makes to the 3rd party API. It is a GET request. Can anyone suggest how can i achieve this. This is Adobe provided code-base, so i am not able to find where is the actual request getting triggered in Adobe IO.

 

Regards,

Saleem

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

3 Replies

Avatar

Employee

Hi @saleemr22640314 - is your question specifically about writing an Adobe I/O Runtime action making GET requests to 3rd party API? The action is written in node.js, and you could leverage any HTTP request library such as node-fetch.

If you ask about other Adobe I/O services, please post this to the respective forum so that those teams will provide more specific support.

Avatar

Level 1
This question is specifically about Adobe I/O Runtime. GET request call to 3rd party API is already there and it is working, we only need to pass a custom header with that call.

Avatar

Employee

Ok - as mentioned earlier you could add custom headers using any HTTP lib. Example with node-fetch:

fetch('https://example.com/getUser', {
    method: 'get',
    headers: { 'X-My-Custom-Header': 'value-v' }
})