Overview
  • 02 Oct 2024
  • Dark
    Light
  • PDF

Overview

  • Dark
    Light
  • PDF

Article summary

Headers

Adapters will automatically add Content-Type and Accept headers based on the requestDatatype and responseDatatype in the endpoint configuration (action.json). You can override these headers within the adapter or the adapter service instance configruation. Adapters will also calculate and add the Content-length header to calls that have a payload.

Any headers used for authentication purposes should be defined in the auth_field and auth_field_format fields within the service instance configuration.

Quite often a system will want headers and/or custom headers to be passed on http calls. These headers can be static (same header and value on all calls) or dynamic (different headers or different values on each call). Adapters have different ways to add headers to a call. This article will go through the options that are available.

Headers can also be applied to specific calls or to all calls within a request.

The best practice to identify where to add a header is to first determine whether the header is static or dynamic. Then determine whether the header is for a specific call or for all calls.

Adding Static Header(s) to Calls

If a header value is static and only added to a specific call, then you would pass it in the action.json file under the headers object. For more information and examples, please click on view resource.

If a header value is static and added to all calls, then you would pass it in service instance configurations under the addlheaders property located in the global_request object. For more information and examples, please click on view resource.

Both of these will override what is autopopulated into headers by requestDatatype.
Note: Setting the incorrect requestDatatype may have other implications as the default is JSON.

Adding Dynamic Header(s) to Calls

If the header or its value is dynamic, then you would pass it in the adapter.js reqObj under the addlHeaders field. This will require you to expose a parameter in the adapter.js method and pronghorn.json to pass in the dynamic value for the header.

If the adapter already supports/exposes the iapMetadata object on the adapter method, then all you need to do is pass an addlHeader object containing your dynamic header and values in that object.

For more information and examples, please click on view resource.


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.