Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save steveosoule/22b53b8d8086339911efcb7049915489 to your computer and use it in GitHub Desktop.
Save steveosoule/22b53b8d8086339911efcb7049915489 to your computer and use it in GitHub Desktop.
Miva - mvt:call and get the Content-Length header
<mvt:call action="'https://www.example.com'" method="'GET'">
<mvt:assign name="l.settings:headers" value="s.callreturnheader" />
</mvt:call>
<mvt:foreach iterator="header" array="headers">
<mvt:if expr="'Content-Length:' IN l.settings:header EQ 1">
<mvt:assign name="l.found" value="miva_splitstring( l.settings:header, ':', l.header_parts, 'trim' )" />
<mvt:assign name="l.content_length" value="l.header_parts[2]" />
</mvt:if>
</mvt:foreach>
Content-Length: <mvt:eval expr="l.content_length" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment