p:http-request 133 (NW)

Test timeout on p:http-request when fail-on-timeout is false.

Test nw-http-request-133.xml is expected to pass.

It requires the following features: p:http-request.

The pipeline


<p:declare-step xmlns:c="http://www.w3.org/ns/xproc-step" xmlns:err="http://www.w3.org/ns/xproc-error" xmlns:p="http://www.w3.org/ns/xproc" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-inline-prefixes="c xs" version="3.0">
   <p:output port="result"/>
   <p:http-request method="get" href="http://localhost:8246/service/slow" assert="true()" parameters="map{'timeout': 2, 'fail-on-timeout': false()}">
      <p:with-input>
         <p:empty/>
      </p:with-input>
   </p:http-request>
   <!-- Make the report be the default-readable-port -->
   <p:identity>
      <p:with-input pipe="report"/>
   </p:identity>
   <p:identity>
      <p:with-input>
         <code>{.?status-code}</code>
      </p:with-input>
   </p:identity>
</p:declare-step>

Schematron validation


<s:schema xmlns="http://www.w3.org/1999/xhtml" xmlns:err="http://www.w3.org/ns/xproc-error" xmlns:s="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
   <s:pattern>
      <s:rule context="/">
         <s:assert test="code">Root element is not 'code'.</s:assert>
         <s:assert test=". = '408'">The status code is not 408.</s:assert>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

26 Dec 2024, Norman Walsh

Initial commit.