Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save steveosoule/772f161a5eb375ead744bf0136e474bf to your computer and use it in GitHub Desktop.

Select an option

Save steveosoule/772f161a5eb375ead744bf0136e474bf to your computer and use it in GitHub Desktop.
<mvt:comment>
Loop over the mvt:call response headers
</mvt:comment>
<mvt:call action="'https://ssoule.mivamerchantdev.com/robots.txt'" method="'GET'">
<mvt:assign name="l.settings:headers" value="s.callreturnheader" />
</mvt:call>
<mvt:foreach iterator="header" array="headers">
<mvt:if expr="'Set-Cookie' CIN l.settings:header">
&mvt:header;
</mvt:if>
</mvt:foreach>
<hr>
<mvt:comment>
Dump all the `s.call...` variables for debugging
</mvt:comment>
<mvt:call action="'https://ssoule.mivamerchantdev.com/robots.txt'" method="'GET'">
<mvt:assign name="l.members" value="miva_getvarlist('s')" />
<mvt:assign name="l.settings:members" value="miva_array_deserialize(l.members)" />
<table>
<mvt:foreach iterator="member" array="members">
<mvt:if expr="'call' IN l.settings:member NE 1">
<mvt:foreachcontinue />
</mvt:if>
<tr>
<mvt:assign name="l.settings:variable_value" value="miva_variable_value( 's.' $ l.settings:member)" />
<td><strong>&mvt:member;</strong></td>
<mvt:if expr="miva_array_elements(l.settings:variable_value) GT 0">
<td><mvt:eval expr="glosub(miva_array_serialize(l.settings:variable_value), ',', '<br />')" /></td>
<mvt:else>
<td>&mvt:variable_value;</td>
</mvt:if>
</tr>
</mvt:foreach>
</table>
</mvt:call>

Set-Cookie: X-MyTest=1;path=/;


Variable Value
s.callservercertificate -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE-----
s.callreturnheader1 HTTP/1.1 200 OK
s.callreturnheader [1]=HTTP%2F1.1+200+OK
[2]=Date%3A+Wed%2C+08+Jun+2022+22%3A51%3A04+GMT
[3]=Server%3A+Apache
[4]=Last-Modified%3A+Fri%2C+15+May+2020+22%3A04%3A43+GMT
[5]=ETag%3A+%2256-5a5b700209885%22
[6]=Accept-Ranges%3A+bytes
[7]=Content-Length%3A+86
[8]=Vary%3A+Accept-Encoding
[9]=X-ssoule%3A+this+is+a+test
[10]=X-MyTest%3A+1
[11]=Set-Cookie%3A+X-MyTest%3D1%3Bpath%3D%2F%3B
[12]=Accept-CH%3A+Device-Memory%2C+Downlink%2C+DPR%2C+ECT%2C+RTT%2C+Save-Data%2C+Viewport-Width%2C+Width
[13]=Connection%3A+close
[14]=Content-Type%3A+text%2Fplain
[15]=Strict-Transport-Security%3A+max-age%3D15768000
s.callreturnheader2 Date: Wed, 08 Jun 2022 22:51:04 GMT
s.callreturnheader3 Server: Apache
s.callreturnheader4 Last-Modified: Fri, 15 May 2020 22:04:43 GMT
s.callreturnheader5 ETag: "56-5a5b700209885"
s.callreturnheader6 Accept-Ranges: bytes
s.callreturnheader7 Content-Length: 86
s.callreturnheader8 Vary: Accept-Encoding
s.callreturnheader9 X-ssoule: this is a test
s.callreturnheader10 X-MyTest: 1
s.callreturnheader11 Set-Cookie: X-MyTest=1;path=/;
s.callreturnheader12 Accept-CH: Device-Memory, Downlink, DPR, ECT, RTT, Save-Data, Viewport-Width, Width
s.callreturnheader13 Connection: close
s.callreturnheader14 Content-Type: text/plain
s.callreturnheader15 Strict-Transport-Security: max-age=15768000
s.callnumberofheaders 15
s.callobjectattribute
s.callobjectvalue
s.callobjecttype text
s.callvalue # User-agent: * # Disallow: / Sitemap: https://ssoule.mivamerchantdev.com/sitemap.xml
s.callobjectnumattributes 0
s.callobjectelement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment