<?xml version="1.0" encoding="utf-8"?>
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
        xml:base="/ab-http-request-118.xml"
        name="ab-http-request-118.xml"
        features="p:http-request"
        expected="pass">
   <t:info xmlns:err="http://www.w3.org/ns/xproc-error">
      <t:title>p:http-request 118 (AB)</t:title>
      <t:revision-history>
         <t:revision>
            <t:date>2025-05-23</t:date>
            <t:author>
               <t:name>Norm Tovey-Walsh</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>Added static options for web server host and port.</p>
            </t:description>
         </t:revision>
         <t:revision>
            <t:date>2021-09-24</t:date>
            <t:author>
               <t:name>Achim Berndzen</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>Test send-body-anyway for p:http-request method GET.</p>
            </t:description>
         </t:revision>
      </t:revision-history>
   </t:info>
   <t:description xmlns="http://www.w3.org/1999/xhtml"
                  xmlns:err="http://www.w3.org/ns/xproc-error">
      <p>If you don’t specify send-body-anyway=true, the body isn’t sent. (method=GET)</p>
   </t:description>
   <t:pipeline xmlns:err="http://www.w3.org/ns/xproc-error">
      <p:declare-step xmlns:c="http://www.w3.org/ns/xproc-step"
                      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:option name="WHOST" select="'http://localhost:8246'" static="true"/>
         <p:output port="result"/>
         <p:http-request href="{$WHOST}/service/check-singlepart"
                         parameters="map{'send-body-anyway' : false()}"
                         method="get">
            <p:with-input>
               <doc1/>
            </p:with-input>
         </p:http-request>
      </p:declare-step>
   </t:pipeline>
   <t:schematron xmlns:err="http://www.w3.org/ns/xproc-error">
      <s:schema xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://purl.oclc.org/dsdl/schematron"
                queryBinding="xslt2">
         <s:ns prefix="p" uri="http://www.w3.org/ns/xproc"/>
         <s:ns prefix="c" uri="http://www.w3.org/ns/xproc-step"/>
         <s:pattern>
            <s:rule context="/*">
               <s:assert test="self::check-singlepart">The pipeline root is not check-singlepart.</s:assert>
               <s:assert test="empty(body)">Request included a body.</s:assert>
            </s:rule>
         </s:pattern>
      </s:schema>
   </t:schematron>
   <t:result name="ab-http-request-118.xml">
      <check-singlepart method="GET" content-type="application/xml"/>
   </t:result>
</t:test>
