Skip to content

mvt:call - Pass Custom Headers#


Description#

This shows an example of how to pass custom headers using mvt:call. Each header must end with crlf.

Snippet#

<mvt:assign name="g.api_endpoint" value="'https://DJDHGSDJD-dsn.algolia.net'" />
<mvt:assign name="g.index_name" value="'docs.miva'" />

<mvt:assign name="g.path" value="'/1/indexes/' $ g.index_name $ '/390342730'" />
<mvt:assign name="g.api_request" value="g.api_endpoint $ g.path" />

<mvt:assign name="g.headers" value="'X-Algolia-API-Key: 17181817181912' $ asciichar( 13 ) $ asciichar( 10 )" />
<mvt:assign name="g.headers" value=" g.headers $ 'X-Algolia-Application-Id: HSGDJDJDGD' $ asciichar( 13 ) $ asciichar( 10 )" />

<mvt:call action="g.api_request" method="'PUT'" headers="'g.headers'">
<mvt:eval expr="s.callvalue" />
</mvt:call>

Functions Used#

  • mvt:call