Skip to content

HttpHandlers

The httpHandlers section allows you to create message handlers as a middleware in your Http Client Communications.

This is useful when you needed add a default behavior on all requests for a given service, as an example, add the Token in Authorization header.

Fields

A httpHandler contains the following fields to be defined:

Name

The name of httpHandler to be created.

Requirements Rules:

  • Is Required;
  • Must not be a Reserved Keyword;
  • Must start with a letter;
  • Must contains only letters, numbers and the underline char ('_');
  • Max length of 50 chars

Example:

1
2
HttpHandlers:
- Name: My_First_HttpHandler


Type

The type of httpHandler to be created.

Possible types are:

  • AddClientAccessToken: Adds a ClientApp access Token to all requests for an HttpCommunication client. This type uses credentials from ClientApps registered with the grant type 'client_credential', which are specifically used for 'System x System' communication.

Requirements Rules:

  • Is Required;
  • The type must be valid, according to the types informed above

Example:

1
2
3
HttpHandlers:
- Name: My_First_HttpHandler
  Type: AddClientAccessToken


BackChannelName

The HttpCommunication name that will be used if the current httpHandler needs to make a Http call.

Requirements Rules:

  • Is Required when the type is AddClientAccessToken;
  • The name must exist in HttpCommunication list in the current model

Example:

1
2
3
4
HttpHandlers:
- Name: My_First_HttpHandler
  Type: AddClientAccessToken
  BackChannelName: My_First_HttpCommunication


AddClientAccessTokenParams

Information for obtaining the Token that will be attached to each Http call. The filling is optional and exclusive for the AddClientAccessToken type.

Requirements Rules:

Example:

1
2
3
4
5
6
7
8
HttpHandlers:
- Name: My_First_HttpHandler
  Type: AddClientAccessToken
  BackChannelName: My_First_HttpCommunication
  AddClientAccessTokenParams:
    Scopes:
    - ServiceSource
    ...


Back to top