Dynamic Headers
  • 05 Dec 2022
  • Dark
    Light
  • PDF

Dynamic Headers

  • Dark
    Light
  • PDF

Article summary

In some cases, dynamic headers should be added to a call. This can include changing the content-type, providing audit headers, or supplying other headers needed on the request.

  • Dynamic headers can be encoded in the adapter.js, or you can pass them into adapter.js and then add a method param.

  • If headers are the same on every call and static, consider using a global_request property to define the headers instead of adding them into every method in the adapter.js.

Example: Dynamic headers.

const reqObj =
  payload: { garbage: 'need since post' },
  uriPathVars: [groupId, deviceId],
  uriQuery: { name: 'anyname' },
  uriOptions: { page: 2 },
  addlHeaders: { audit: 'turnOn' },
  authData: { domain: 'abc' },
  callProperties: {
    stub: true,
    request: {
      attempt_timeout = 60000
    }
  },
  filter: '[*name=doggie]',
  priority: 1,
  event: 'giveMeMyData'
};

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.